]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: wash: make word-wrap bound message width
authorMark Walters <markwalters1009@gmail.com>
Sat, 6 Aug 2016 15:29:34 +0000 (16:29 +0100)
committerDavid Bremner <david@tethera.net>
Mon, 12 Sep 2016 11:06:00 +0000 (08:06 -0300)
Previously if notmuch-wash-wrap-lines-length was set then all messages
would be wrapped at this value (or window-width if that is
smaller). This was done regardless of the message's depth in a thread --
for example, if the n.w.w.l.l is 80 and the messages depth is 20
(so indented 20 by default) the messages text only got 60 characters
of space.

This commit changes that so a message always gets the full n.w.w.l.l
of width regardless of its indentation (unless that goes over
window-width of course).

emacs/notmuch-wash.el

index 07fc1a1f6325363df0e0a55268899851dd3cc109..5f8b92671b39ac2419ef4808e27296d062bc885a 100644 (file)
@@ -122,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
 
 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)
   :type '(choice (const :tag "window width" nil)
                 (integer :tag "number of characters"))
   :group 'notmuch-wash)
@@ -338,7 +338,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)
   (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
                         (window-width))
                  (window-width)))
         (fill-column (- limit