summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2023-11-04 13:42:36 -0400
committerKjetil Orbekk <kj@orbekk.com>2023-11-04 13:42:36 -0400
commit904aab8a3a2e3a6af01ece754d8bacedf87906c4 (patch)
treee9400984d8c92705db4fb0210321a309d85f08cd
parent6b8cc11a49d2bb8da917fa8d3f9426792dea528d (diff)
email
-rw-r--r--emacs/.config/emacs-kj/lisp/kj-email.el20
1 files changed, 11 insertions, 9 deletions
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