X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-wash.el;h=3a9ffdd0daf75af50deb80504ffeae9ee98410ff;hb=a4617f29ce81e7ae3e0cb747fdb9070f88407a28;hp=07fc1a1f6325363df0e0a55268899851dd3cc109;hpb=999d473299781cb2a38fba5d9e2452504799a7a2;p=notmuch diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el index 07fc1a1f..3a9ffdd0 100644 --- a/emacs/notmuch-wash.el +++ b/emacs/notmuch-wash.el @@ -24,8 +24,10 @@ ;;; Code: (require 'coolj) +(require 'notmuch-lib) -(declare-function notmuch-show-insert-bodypart "notmuch-show" (msg part depth &optional hide)) +(declare-function notmuch-show-insert-bodypart "notmuch-show" + (msg part depth &optional hide)) (defvar notmuch-show-indent-messages-width) ;; @@ -122,8 +124,8 @@ collapse the remaining lines into a button." If this is nil, lines in messages will be wrapped to fit in the current window. If this is a number, lines will be wrapped after -this many characters or at the window width (whichever one is -lower)." +this many characters (ignoring indentation due to thread depth) +or at the window width (whichever one is lower)." :type '(choice (const :tag "window width" nil) (integer :tag "number of characters")) :group 'notmuch-wash) @@ -186,13 +188,16 @@ message parts." (let* ((type (overlay-get overlay 'type)) (invis-spec (overlay-get overlay 'invisible)) (state (if (invisible-p invis-spec) "hidden" "visible")) - (label-format (symbol-value (intern-soft (concat "notmuch-wash-button-" - type "-" state "-format")))) - (lines-count (count-lines (overlay-start overlay) (overlay-end overlay)))) + (label-format (symbol-value + (intern-soft + (format "notmuch-wash-button-%s-%s-format" + type state)))) + (lines-count (count-lines (overlay-start overlay) + (overlay-end overlay)))) (format label-format lines-count))) (defun notmuch-wash-region-to-button (msg beg end type &optional prefix) - "Auxiliary function to do the actual making of overlays and buttons + "Auxiliary function to do the actual making of overlays and buttons. BEG and END are buffer locations. TYPE should a string, either \"citation\" or \"signature\". Optional PREFIX is some arbitrary @@ -238,7 +243,8 @@ 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 'notmuch-wash-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)) @@ -260,7 +266,8 @@ that PREFIX should not include a newline." (sig-end-marker (make-marker))) (set-marker sig-start-marker sig-start) (set-marker sig-end-marker (point-max)) - (overlay-put (make-overlay sig-start-marker sig-end-marker) 'face 'message-cited-text) + (overlay-put (make-overlay sig-start-marker sig-end-marker) + 'face 'message-cited-text) (notmuch-wash-region-to-button msg sig-start-marker sig-end-marker "signature")))))) @@ -338,7 +345,7 @@ the wrapped text are maintained." (let* ((coolj-wrap-follows-window-size nil) (indent (* depth notmuch-show-indent-messages-width)) (limit (if (numberp notmuch-wash-wrap-lines-length) - (min notmuch-wash-wrap-lines-length + (min (+ notmuch-wash-wrap-lines-length indent) (window-width)) (window-width))) (fill-column (- limit