summaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2023-11-02 21:34:15 -0400
committerKjetil Orbekk <kj@orbekk.com>2023-11-02 21:34:25 -0400
commit669c2c50cba01bdd761d10a12fc16a018afd8e82 (patch)
treeeaf48c918ff65a6c715456a2dcf4b69671b14807 /emacs
parentfe8c85b341c1aecb2834aa1ca7f54ca876fef377 (diff)
fix citation
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.config/emacs-kj/lisp/kj-email.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/emacs/.config/emacs-kj/lisp/kj-email.el b/emacs/.config/emacs-kj/lisp/kj-email.el
index 753a3cc..a134b5f 100644
--- a/emacs/.config/emacs-kj/lisp/kj-email.el
+++ b/emacs/.config/emacs-kj/lisp/kj-email.el
@@ -38,7 +38,7 @@
(:name "all mail" :query "*" :key "a" :search-type tree)
)))
- (setq kj/notmuch-wash-citation-regexp "\\(^[[:space:]]*\\)\\(>+\\)\\(.*\n+\\)")
+ (setq kj/notmuch-wash-citation-regexp "^\\(\\(>\\|[[:space:]]\\)*\\).*\n")
;;; XXX consider upstreaming this.
(defun kj/notmuch-wash-citations-by-depth (_msg _depth)
@@ -54,9 +54,9 @@
(let* ((cite-start (match-beginning 0))
(cite-end (match-end 0))
- (cite-level (min (length (match-string 2))
- maxlevel))
- (cited-text-face (intern (format "message-cited-text-%d" cite-level))))
+ (cite-level (seq-count (lambda (c) (eql c ?>)) (match-string 1)))
+ (face-level (1+ (% (1- cite-level) maxlevel)))
+ (cited-text-face (intern (format "message-cited-text-%d" face-level))))
(overlay-put (make-overlay cite-start cite-end)
'face cited-text-face)))))
(add-hook 'notmuch-show-insert-text/plain-hook #'kj/notmuch-wash-citations-by-depth 90)