X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=blobdiff_plain;f=elpher.el;h=5ce6992a843110f3dc57504674c2c863491f5f10;hb=3a33e9043d75d7f7c58daee30d802a0066e3fd74;hp=ab2a7f0165b7690091306304a2f3dcac23dcf60f;hpb=ddd34e624559ec7790bdad45192ab2f5edbc06a3;p=elpher.git diff --git a/elpher.el b/elpher.el index ab2a7f0..5ce6992 100644 --- a/elpher.el +++ b/elpher.el @@ -258,6 +258,10 @@ Otherwise, the SOCKS proxy is only used for connections to onion services." '((t :inherit fixed-pitch)) "Face used for pre-formatted gemini text blocks.") +(defface elpher-gemini-quoted + '((t :inherit font-lock-doc-face)) + "Face used for gemini quoted texts.") + ;;; Model ;; @@ -1398,13 +1402,19 @@ by HEADER-LINE." This function uses Emacs' auto-fill to wrap text sensibly to a maximum width defined by elpher-gemini-max-fill-width." (string-match "\\(^[ \t]*\\)\\(\*[ \t]+\\|>[ \t]*\\)?" text-line) - (let* ((processed-text-line (if (match-string 2 text-line) - (concat - (replace-regexp-in-string "\*" - elpher-gemini-bullet-string - (match-string 0 text-line)) - (substring text-line (match-end 0))) - text-line)) + (let* ((line-prefix (match-string 2 text-line)) + (processed-text-line + (if line-prefix + (cond ((string-prefix-p "*" line-prefix) + (concat + (replace-regexp-in-string "\*" + elpher-gemini-bullet-string + (match-string 0 text-line)) + (substring text-line (match-end 0)))) + ((string-prefix-p ">" line-prefix) + (propertize text-line 'face 'elpher-gemini-quoted)) + (t text-line)) + text-line)) (adaptive-fill-mode nil)) (insert (elpher-process-text-for-display processed-text-line)) (newline))) @@ -1628,6 +1638,9 @@ bookmark list, while URL is the url of the entry." (defun elpher-save-bookmarks (bookmarks) "Record the bookmark list BOOKMARKS to the user's bookmark file. Beware that this completely replaces the existing contents of the file." + (let ((bookmark-dir (file-name-directory elpher-bookmarks-file))) + (unless (file-directory-p bookmark-dir) + (make-directory bookmark-dir))) (with-temp-file elpher-bookmarks-file (erase-buffer) (insert "; Elpher bookmarks file\n\n"