;;; 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)
;;
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)
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)))