[PATCH 2/2] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 1c / 218d63a9e428ae5ac89294755eb7ed6ec599a5
1 Return-Path: <markwalters1009@gmail.com>\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 5C52D6DE0363\r
6  for <notmuch@notmuchmail.org>; Sat,  6 Aug 2016 08:30:00 -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.346\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.346 tagged_above=-999 required=5 tests=[AWL=0.224,\r
12   DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13  FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7,\r
14  RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001]\r
15  autolearn=disabled\r
16 Received: from arlo.cworth.org ([127.0.0.1])\r
17  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
18  with ESMTP id xqAJczYaKjaZ for <notmuch@notmuchmail.org>;\r
19  Sat,  6 Aug 2016 08:29:52 -0700 (PDT)\r
20 Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com\r
21  [74.125.82.65]) by arlo.cworth.org (Postfix) with ESMTPS id 5E0C46DE00DF for\r
22  <notmuch@notmuchmail.org>; Sat,  6 Aug 2016 08:29:52 -0700 (PDT)\r
23 Received: by mail-wm0-f65.google.com with SMTP id q128so7930640wma.1\r
24  for <notmuch@notmuchmail.org>; Sat, 06 Aug 2016 08:29:52 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
26  h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
27  bh=60xOW2q70z5dpaW/i62Gmz2pSolW0gZxfmGT0VD//M8=;\r
28  b=jshoNYwSRZydBF/N3MaVWL1szdnoUQyH1bXNwPX/StfpOGSO9sODKtB2F/sPcKUe6f\r
29  X2xmJYcG9AYrHNk9fZvxIympB9EANJIYbZJ1ybCyZzcyy/jDhAJq2tqcIljOn/pKNadt\r
30  JlqdmI9eQuuzuyuWCgRFMVM/FiyuEYI/Kd2b8hKmQHFOHVJxOm3TQdpEq+CZP5Iro5Op\r
31  IxFGu+0Oqzg1nQGtF6W2TRNmqGMhMLahWbon9QLeruhKwzNvLnJkCdQvq3SPKvF+NZ1x\r
32  dRYeeoXIxqrjGM1WKljuPeQiB1pDesTlOBHtQiruSGf+yPE9jIU/oecZ/corXg/46CQ4\r
33  AA3Q==\r
34 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
35  d=1e100.net; s=20130820;\r
36  h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
37  :references;\r
38  bh=60xOW2q70z5dpaW/i62Gmz2pSolW0gZxfmGT0VD//M8=;\r
39  b=V4kOLERSt/pgExDvFsod2xO+zrvpngaKSHIuU8s4QQn7MhzQOrU3OCgHBdmyyQMSKd\r
40  pjvhOIAAmjfoh+5nGeEcuLvDTMaNkU3mPVsAR0hrSbWIsVLtlljExPwL081DX36D04oY\r
41  Qy9UYwr7kP2dH0V8P+sU1nrIGMpDI88XbggbnESOpfz42CbHRp5fWFnwi/gQinxQ9u+/\r
42  qEHeL/RFPba/dZPgEsvyhZ8hgR3Ru71cVfamJbaBm2YQe9EanwLz8E8ENKea6iHup+iO\r
43  0BWeu67JTem33EK8g4ZFxv411WXfHUVCtk/VqfZ/VO8mJ5Of1W/pY3YXQze6NechwZpX\r
44  P6Xg==\r
45 X-Gm-Message-State:\r
46  AEkoouvx+MnXhTaqLOKp4c0/sepzGbGQ29Sc+twipu7Dascse/V10ExqpplBNJpdO73u8g==\r
47 X-Received: by 10.194.104.106 with SMTP id gd10mr46782901wjb.55.1470497390695;\r
48   Sat, 06 Aug 2016 08:29:50 -0700 (PDT)\r
49 Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162])\r
50  by smtp.gmail.com with ESMTPSA id k186sm14152089wmd.13.2016.08.06.08.29.47\r
51  (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
52  Sat, 06 Aug 2016 08:29:47 -0700 (PDT)\r
53 From: Mark Walters <markwalters1009@gmail.com>\r
54 To: notmuch@notmuchmail.org\r
55 Subject: [PATCH 2/2] emacs: wash: make word-wrap bound message width\r
56 Date: Sat,  6 Aug 2016 16:29:34 +0100\r
57 Message-Id: <1470497374-17194-3-git-send-email-markwalters1009@gmail.com>\r
58 X-Mailer: git-send-email 2.1.4\r
59 In-Reply-To: <1470497374-17194-1-git-send-email-markwalters1009@gmail.com>\r
60 References: <1470497374-17194-1-git-send-email-markwalters1009@gmail.com>\r
61 X-BeenThere: notmuch@notmuchmail.org\r
62 X-Mailman-Version: 2.1.20\r
63 Precedence: list\r
64 List-Id: "Use and development of the notmuch mail system."\r
65  <notmuch.notmuchmail.org>\r
66 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
67  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
68 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
69 List-Post: <mailto:notmuch@notmuchmail.org>\r
70 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
71 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
72  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
73 X-List-Received-Date: Sat, 06 Aug 2016 15:30:00 -0000\r
74 \r
75 Previously if notmuch-wash-wrap-lines-length was set then all messages\r
76 would be wrapped at this value (or window-width if that is\r
77 smaller). This was done regardless of the message's depth in a thread --\r
78 for example, if the n.w.w.l.l is 80 and the messages depth is 20\r
79 (so indented 20 by default) the messages text only got 60 characters\r
80 of space.\r
81 \r
82 This commit changes that so a message always gets the full n.w.w.l.l\r
83 of width regardless of its indentation (unless that goes over\r
84 window-width of course).\r
85 ---\r
86  emacs/notmuch-wash.el | 6 +++---\r
87  1 file changed, 3 insertions(+), 3 deletions(-)\r
88 \r
89 diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el\r
90 index 07fc1a1..5f8b926 100644\r
91 --- a/emacs/notmuch-wash.el\r
92 +++ b/emacs/notmuch-wash.el\r
93 @@ -122,8 +122,8 @@ collapse the remaining lines into a button."\r
94  \r
95  If this is nil, lines in messages will be wrapped to fit in the\r
96  current window. If this is a number, lines will be wrapped after\r
97 -this many characters or at the window width (whichever one is\r
98 -lower)."\r
99 +this many characters (ignoring indentation due to thread depth)\r
100 +or at the window width (whichever one is lower)."\r
101    :type '(choice (const :tag "window width" nil)\r
102                  (integer :tag "number of characters"))\r
103    :group 'notmuch-wash)\r
104 @@ -338,7 +338,7 @@ the wrapped text are maintained."\r
105    (let* ((coolj-wrap-follows-window-size nil)\r
106          (indent (* depth notmuch-show-indent-messages-width))\r
107          (limit (if (numberp notmuch-wash-wrap-lines-length)\r
108 -                   (min notmuch-wash-wrap-lines-length\r
109 +                   (min (+ notmuch-wash-wrap-lines-length indent)\r
110                          (window-width))\r
111                   (window-width)))\r
112          (fill-column (- limit\r
113 -- \r
114 2.1.4\r
115 \r