X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;ds=sidebyside;f=emacs%2Fnotmuch-wash.el;h=54108d93607bf83b228f5f2b17ada5f215e62192;hb=7eb9615b30274033cc0c828244569c709906c40b;hp=a76b4f5b589ab0d0f1ada7ced2bc024e31a5b91b;hpb=5ddaf59915b477d9eccfafaf7e5ac8094ea8f6ca;p=notmuch
diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index a76b4f5b..54108d93 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -1,4 +1,4 @@
-;; notmuch-wash.el --- cleaning up message bodies
+;;; notmuch-wash.el --- cleaning up message bodies
;;
;; Copyright © Carl Worth
;; Copyright © David Edmondson
@@ -16,14 +16,17 @@
;; 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
-(require 'coolj)
+;;; 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)
;;
@@ -119,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)
@@ -333,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)))
@@ -423,3 +427,5 @@ for error."
;;
(provide 'notmuch-wash)
+
+;;; notmuch-wash.el ends here