X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-wash.el;h=fd0314cc6f41e067911e8f5f15b2ce61592889ba;hb=96befd0dd075c5d3a63902d72eff7fc1928ba541;hp=065af16fb071baeb9cd53e1b43ffec85f2beca86;hpb=0cf457b73b4b666314d1a09ac3e31bd0fa2346a6;p=notmuch
diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index 065af16f..fd0314cc 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -16,7 +16,7 @@
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
-;; along with Notmuch. If not, see .
+;; along with Notmuch. If not, see .
;;
;; Authors: Carl Worth
;; David Edmondson
@@ -24,8 +24,9 @@
;;; Code:
(require 'coolj)
-
+(require 'notmuch-lib)
(declare-function notmuch-show-insert-bodypart "notmuch-show" (msg part depth &optional hide))
+(defvar notmuch-show-indent-messages-width)
;;
@@ -121,8 +122,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)
@@ -191,7 +192,7 @@ message parts."
(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
@@ -335,12 +336,13 @@ message at the window width. When doing so, citation leaders in
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
- depth
+ indent
;; 2 to avoid poor interaction with
;; `word-wrap'.
2)))