X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-wash.el;h=184440004a3fb860ec01dc61bfb8c9d6eaef1160;hb=092b159be7984ec32e06bae9fcdee2f6bcf54394;hp=80c475c6c1b94dbf243c7af875a6b98fc3fd58d5;hpb=8bee3c417c44afdf04fda7a3495d598a99f6d9bc;p=notmuch diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el index 80c475c6..18444000 100644 --- a/emacs/notmuch-wash.el +++ b/emacs/notmuch-wash.el @@ -27,6 +27,10 @@ ;; +(defgroup notmuch-wash nil + "Cleaning up messages for display." + :group 'notmuch) + (defvar notmuch-wash-signature-regexp "^\\(-- ?\\|_+\\)$" "Pattern to match a line that separates content from signature.") @@ -95,6 +99,19 @@ current window. If this is a number, lines will be wrapped after this many characters or at the window width (whichever one is lower).") +(defface notmuch-wash-toggle-button + '((t (:inherit font-lock-comment-face))) + "Face used for buttons toggling the visibility of washed away +message parts." + :group 'notmuch-wash + :group 'notmuch-faces) + +(defface notmuch-wash-cited-text + '((t (:inherit message-cited-text))) + "Face used for cited text." + :group 'notmuch-wash + :group 'notmuch-faces) + (defun notmuch-wash-toggle-invisible-action (cite-button) ;; Toggle overlay visibility (let ((overlay (button-get cite-button 'overlay))) @@ -104,9 +121,11 @@ lower).") (overlay (button-get cite-button 'overlay)) (button-label (notmuch-wash-button-label overlay)) (old-point (point)) + (properties (text-properties-at (point))) (inhibit-read-only t)) (goto-char new-start) (insert button-label) + (set-text-properties new-start (point) properties) (let ((old-end (button-end cite-button))) (move-overlay cite-button new-start (point)) (delete-region (point) old-end)) @@ -115,7 +134,7 @@ lower).") (define-button-type 'notmuch-wash-button-invisibility-toggle-type 'action 'notmuch-wash-toggle-invisible-action 'follow-link t - 'face 'font-lock-comment-face + 'face 'notmuch-wash-toggle-button :supertype 'notmuch-button-type) (define-button-type 'notmuch-wash-button-citation-toggle-type @@ -190,7 +209,7 @@ that PREFIX should not include a newline." (let* ((cite-start (match-beginning 0)) (cite-end (match-end 0)) (cite-lines (count-lines cite-start cite-end))) - (overlay-put (make-overlay cite-start cite-end) 'face 'message-cited-text) + (overlay-put (make-overlay cite-start cite-end) 'face 'notmuch-wash-cited-text) (when (> cite-lines (+ notmuch-wash-citation-lines-prefix notmuch-wash-citation-lines-suffix 1)) @@ -365,7 +384,7 @@ for error." (setq patch-end (match-beginning 0))) (save-restriction (narrow-to-region patch-start patch-end) - (setq part (plist-put part :content-type "inline-patch-fake-part")) + (setq part (plist-put part :content-type "inline patch")) (setq part (plist-put part :content (buffer-string))) (setq part (plist-put part :id -1)) (setq part (plist-put part :filename