From 904aab8a3a2e3a6af01ece754d8bacedf87906c4 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Sat, 4 Nov 2023 13:42:36 -0400 Subject: email --- emacs/.config/emacs-kj/lisp/kj-email.el | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'emacs') diff --git a/emacs/.config/emacs-kj/lisp/kj-email.el b/emacs/.config/emacs-kj/lisp/kj-email.el index e5c8e6c..2aa2659 100644 --- a/emacs/.config/emacs-kj/lisp/kj-email.el +++ b/emacs/.config/emacs-kj/lisp/kj-email.el @@ -14,6 +14,8 @@ notmuch-archive-tags '("-inbox" "-unread") notmuch-fcc-dirs nil notmuch-show-logo nil + notmuch-wash-citation-lines-prefix most-positive-fixnum + notmuch-wash-citation-lines-suffix most-positive-fixnum notmuch-show-indent-messages-width 0) (add-hook 'message-mode-hook 'turn-off-auto-fill) (add-hook 'message-mode-hook 'visual-line-mode) @@ -38,20 +40,19 @@ (: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) (goto-char (point-min)) (beginning-of-line) - (while (and (< (point) (point-max)) - (re-search-forward kj/notmuch-wash-citation-regexp nil t)) - - (let ((maxlevel 1)) - (while (intern-soft (format "message-cited-text-%d" maxlevel)) - (setq maxlevel (1+ maxlevel))) - (setq maxlevel (1- maxlevel)) + (let ((maxlevel 1)) + (while (intern-soft (format "message-cited-text-%d" maxlevel)) + (setq maxlevel (1+ maxlevel))) + (setq maxlevel (1- maxlevel)) + (while (and (< (point) (point-max)) + (re-search-forward kj/notmuch-wash-citation-regexp nil t)) (let* ((cite-start (match-beginning 0)) (cite-end (match-end 0)) (cite-level (seq-count (lambda (c) (eql c ?>)) (match-string 1))) @@ -59,7 +60,8 @@ (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) + ;; This doesn't seem to work that well... :( + ;;(add-hook 'notmuch-show-insert-text/plain-hook #'kj/notmuch-wash-citations-by-depth 90) (defun kj/notmuch-tree-by-tag (tag) (interactive -- cgit v1.2.3