Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 64 / cfcd47535168a2d4e2f105cf4a61dab8fe9411
1 Return-Path: <tomi.ollila@iki.fi>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5  by arlo.cworth.org (Postfix) with ESMTP id A04726DE0BAC\r
6  for <notmuch@notmuchmail.org>; Sat, 20 Aug 2016 13:08:29 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.557\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.557 tagged_above=-999 required=5 tests=[AWL=-0.095,\r
12   SPF_NEUTRAL=0.652] autolearn=disabled\r
13 Received: from arlo.cworth.org ([127.0.0.1])\r
14  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
15  with ESMTP id vfwggdjR023N for <notmuch@notmuchmail.org>;\r
16  Sat, 20 Aug 2016 13:08:29 -0700 (PDT)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18  by arlo.cworth.org (Postfix) with ESMTP id EEAF36DE0B7C\r
19  for <notmuch@notmuchmail.org>; Sat, 20 Aug 2016 13:08:28 -0700 (PDT)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21  by guru.guru-group.fi (Postfix) with ESMTP id 5B434100090;\r
22  Sat, 20 Aug 2016 23:08:09 +0300 (EEST)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
25 Subject: Re: [PATCH] emacs: wash: make word-wrap bound message width\r
26 In-Reply-To: <1467791251-6823-1-git-send-email-markwalters1009@gmail.com>\r
27 References: <1467791251-6823-1-git-send-email-markwalters1009@gmail.com>\r
28 User-Agent: Notmuch/0.22+61~geeecb9e (https://notmuchmail.org) Emacs/24.5.1\r
29  (x86_64-unknown-linux-gnu)\r
30 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
31  $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
32  !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
33 Date: Sat, 20 Aug 2016 23:08:09 +0300\r
34 Message-ID: <m2h9afmceu.fsf@guru.guru-group.fi>\r
35 MIME-Version: 1.0\r
36 Content-Type: text/plain\r
37 X-BeenThere: notmuch@notmuchmail.org\r
38 X-Mailman-Version: 2.1.22\r
39 Precedence: list\r
40 List-Id: "Use and development of the notmuch mail system."\r
41  <notmuch.notmuchmail.org>\r
42 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
43  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
45 List-Post: <mailto:notmuch@notmuchmail.org>\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
47 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
48  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
49 X-List-Received-Date: Sat, 20 Aug 2016 20:08:29 -0000\r
50 \r
51 On Wed, Jul 06 2016, Mark Walters <markwalters1009@gmail.com> wrote:\r
52 \r
53 > Previously if notmuch-wash-wrap-lines-length was set then all messages\r
54 > would be wrapped at this value (or window-width if that is\r
55 > smaller). This was done regardless of the message's depth in a thread:\r
56 > for example, if the n.w.w.l.l is 80 and the messages depth is 20\r
57 > (so indented 20 by default) the messages text only got 60 characters\r
58 > of space.\r
59 >\r
60 > This commit changes that so a message always gets the full n.w.w.l.l\r
61 > of width regardless of its indentation (unless that goes over\r
62 > window-width of course).\r
63 > ---\r
64 >\r
65 > This is what I would like -- I don't know if anyone would like to keep\r
66 > the previous behaviour as an option. The code-part for that is easy, but getting\r
67 > the docstrings and and defcustoms right is not clear.\r
68 \r
69 The change looks good to me -- but I just don't understand why someone\r
70 would set notmuch-wash-wrap-lines-length to something else than nil\r
71 -- and if it is set to some number what the behaviour should be ?\r
72 \r
73 Tomi\r
74 \r
75 \r
76 >\r
77 > Best wishes\r
78 >\r
79 > Mark\r
80 >\r
81 > emacs/notmuch-wash.el | 6 +++---\r
82 >  1 file changed, 3 insertions(+), 3 deletions(-)\r
83 >\r
84 > diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el\r
85 > index 57e6dfa..e16b8cc 100644\r
86 > --- a/emacs/notmuch-wash.el\r
87 > +++ b/emacs/notmuch-wash.el\r
88 > @@ -121,8 +121,8 @@ collapse the remaining lines into a button."\r
89 >  \r
90 >  If this is nil, lines in messages will be wrapped to fit in the\r
91 >  current window. If this is a number, lines will be wrapped after\r
92 > -this many characters or at the window width (whichever one is\r
93 > -lower)."\r
94 > +this many characters (ignoring indentation due to thread depth)\r
95 > +or at the window width (whichever one is lower)."\r
96 >    :type '(choice (const :tag "window width" nil)\r
97 >                (integer :tag "number of characters"))\r
98 >    :group 'notmuch-wash)\r
99 > @@ -336,7 +336,7 @@ the wrapped text are maintained."\r
100 >  \r
101 >    (let* ((coolj-wrap-follows-window-size nil)\r
102 >        (limit (if (numberp notmuch-wash-wrap-lines-length)\r
103 > -                 (min notmuch-wash-wrap-lines-length\r
104 > +                 (min (+ notmuch-wash-wrap-lines-length depth)\r
105 >                        (window-width))\r
106 >                 (window-width)))\r
107 >        (fill-column (- limit\r
108 > -- \r
109 > 2.1.4\r
110 >\r
111 > _______________________________________________\r
112 > notmuch mailing list\r
113 > notmuch@notmuchmail.org\r
114 > https://notmuchmail.org/mailman/listinfo/notmuch\r