From 669c2c50cba01bdd761d10a12fc16a018afd8e82 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Thu, 2 Nov 2023 21:34:15 -0400 Subject: fix citation --- emacs/.config/emacs-kj/lisp/kj-email.el | 8 ++++---- 1 file 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) -- cgit v1.2.3