From: Tim Vaughan Date: Fri, 22 May 2020 15:44:09 +0000 (+0200) Subject: Gave preformatted text its own configurable face. X-Git-Tag: v2.7.7~2 X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=c0cd7a5c233006cfb53cf8b71b04e4ac5c6c1bac;p=elpher.git Gave preformatted text its own configurable face. --- diff --git a/elpher.el b/elpher.el index 034618a..ca076d0 100644 --- a/elpher.el +++ b/elpher.el @@ -222,6 +222,10 @@ the time when the text is rendered." '((t :inherit bold :height 1.2)) "Face used for gemini heading level 3.") +(defface elpher-gemini-preformatted + '((t :inherit fixed-pitch)) + "Face used for pre-formatted gemini text blocks.") + ;;; Model ;; @@ -1151,7 +1155,9 @@ by HEADER-LINE." (dolist (line (split-string data "\n")) (cond ((string-prefix-p "```" line) (setq preformatted (not preformatted))) - (preformatted (insert (elpher-process-text-for-display line) "\n")) + (preformatted (insert (elpher-process-text-for-display + (propertize line 'face 'elpher-gemini-preformatted)) + "\n")) ((string-prefix-p "=>" line) (elpher-gemini-insert-link line)) ((string-prefix-p "#" line) (elpher-gemini-insert-header line)) (t (insert (elpher-process-text-for-display line)) (newline)))))