[PATCH 1/2] emacs: wash: word-wrap bugfix
authorMark Walters <markwalters1009@gmail.com>
Sat, 6 Aug 2016 15:29:33 +0000 (16:29 +0100)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 23:22:20 +0000 (16:22 -0700)
f2/7db604ecaac449cfef415b6d6d62cdcdaf979e [new file with mode: 0644]

diff --git a/f2/7db604ecaac449cfef415b6d6d62cdcdaf979e b/f2/7db604ecaac449cfef415b6d6d62cdcdaf979e
new file mode 100644 (file)
index 0000000..e13beae
--- /dev/null
@@ -0,0 +1,197 @@
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 4B54E6DE035C\r
+ for <notmuch@notmuchmail.org>; Sat,  6 Aug 2016 08:29:56 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.346\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.346 tagged_above=-999 required=5 tests=[AWL=0.224,\r
+  DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7,\r
+ RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001]\r
+ autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id LSVBhr4vywh2 for <notmuch@notmuchmail.org>;\r
+ Sat,  6 Aug 2016 08:29:47 -0700 (PDT)\r
+Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com\r
+ [74.125.82.67]) by arlo.cworth.org (Postfix) with ESMTPS id 06E776DE012F for\r
+ <notmuch@notmuchmail.org>; Sat,  6 Aug 2016 08:29:47 -0700 (PDT)\r
+Received: by mail-wm0-f67.google.com with SMTP id i5so7922038wmg.2\r
+ for <notmuch@notmuchmail.org>; Sat, 06 Aug 2016 08:29:46 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
+ bh=01S0TYGOFVIUelc+M8VFeb1DAi434dHdz24wa7Cmxz4=;\r
+ b=PxfccBwXTJmzc3WVZkIcad+7nKmyDCkWSpWGkysCLpXFGnQQA1CcCiSX7lZtWygQV6\r
+ hBHpUvY0lj+zazYO6+esX2kEOBFma6hZo7Qvh5W8xBMB7xLrHFlCW+8Xv47zh0Li57fy\r
+ i1mcMM+P2EZ52DtBuTXydaROxRgQPTG9M8V8MVV6mHzARj979oZ0VcQrpPU2ZSXilhJI\r
+ ym5U+AuJ1QUhjPjLe/efQmsGEsvt/ssPSgXkQQWcND6KRMgNAWrJOsfbA1DVHkJaJVz3\r
+ UIxOegMnFNq9+xdhTXa2LO2PeNmN5J1GwfhWoxVgH6jMrB6r/Xx7hU8ZbeBy9OFCBQ1S\r
+ Kx0w==\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
+ :references;\r
+ bh=01S0TYGOFVIUelc+M8VFeb1DAi434dHdz24wa7Cmxz4=;\r
+ b=lOeH+nWM5/s03pFTD4IS2xnmhbDJI4hLYp7eKWKLIqqzPqpaqX4FimKjR1HfJ/d+/q\r
+ X8oXmWUli/6nL6ThQ95OWtuOReEnmyFDNTmkRNB/VM+xoaUiFqwhEnypX14xlcWFmwEa\r
+ 3HxTm4YsaJvbFlx1SIvNDtVX1dQHDnYqCJ3aT7D/FE9G8JmI9PPAsJ5B1KoFtoDiUj4Y\r
+ DgiPCFWMRGtEuJxolbLvjSQglb6gqTt2OFmBxocevTl9j536KkKt/YJ/LIo0b4wDUPT0\r
+ Zsmi+OikjDL6kJk0xmzOx5luHTnkTjtFUUZokpHtR9iTnRpthQhTdZR8Lz5qxELC7QEI\r
+ shVQ==\r
+X-Gm-Message-State:\r
+ AEkoouvlAupZSUwyRCt8xYCkMbzFaHm4KwM+s+/88FWO281XEtr5FTlHm6I18bm3mYwZgA==\r
+X-Received: by 10.28.165.3 with SMTP id o3mr8697741wme.3.1470497385578;\r
+ Sat, 06 Aug 2016 08:29:45 -0700 (PDT)\r
+Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162])\r
+ by smtp.gmail.com with ESMTPSA id i66sm14201637wmg.9.2016.08.06.08.29.44\r
+ (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Sat, 06 Aug 2016 08:29:44 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/2] emacs: wash: word-wrap bugfix\r
+Date: Sat,  6 Aug 2016 16:29:33 +0100\r
+Message-Id: <1470497374-17194-2-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 2.1.4\r
+In-Reply-To: <1470497374-17194-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1470497374-17194-1-git-send-email-markwalters1009@gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 06 Aug 2016 15:29:56 -0000\r
+\r
+Previously notmuch-wash made the width of the text (approximately) the\r
+window-width minus the depth in thread. This is correct for the\r
+default indentation of 1 per message depth, but is incorrect for any\r
+other setting of notmuch-show-indent-messages-width.\r
+\r
+As notmuch-show-indent-messages-width is customisable, and notmuch-tree\r
+sets it to zero to avoid indenting messages in the message pane, this\r
+bug can show up in real use.\r
+\r
+Two of the tests had to be updated: when\r
+notmuch-show-indent-messages-width is 0, then the new (correct) word\r
+wrapping happens later, when notmuch-show-indent-messages-width is 4,\r
+then the new word wrapping happens sooner.\r
+---\r
+ emacs/notmuch-wash.el                                 |  4 +++-\r
+ ...w-thread-maildir-storage-with-fourfold-indentation | 19 ++++++++++++-------\r
+ ...ch-show-thread-maildir-storage-without-indentation |  8 ++++----\r
+ 3 files changed, 19 insertions(+), 12 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el\r
+index 57e6dfa..07fc1a1 100644\r
+--- a/emacs/notmuch-wash.el\r
++++ b/emacs/notmuch-wash.el\r
+@@ -26,6 +26,7 @@\r
+ (require 'coolj)\r
\r
+ (declare-function notmuch-show-insert-bodypart "notmuch-show" (msg part depth &optional hide))\r
++(defvar notmuch-show-indent-messages-width)\r
\r
+ ;;\r
\r
+@@ -335,12 +336,13 @@ message at the window width. When doing so, citation leaders in\r
+ the wrapped text are maintained."\r
\r
+   (let* ((coolj-wrap-follows-window-size nil)\r
++       (indent (* depth notmuch-show-indent-messages-width))\r
+        (limit (if (numberp notmuch-wash-wrap-lines-length)\r
+                   (min notmuch-wash-wrap-lines-length\r
+                        (window-width))\r
+                 (window-width)))\r
+        (fill-column (- limit\r
+-                       depth\r
++                       indent\r
+                        ;; 2 to avoid poor interaction with\r
+                        ;; `word-wrap'.\r
+                        2)))\r
+diff --git a/test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation\r
+index 4721b8b..3bbb114 100644\r
+--- a/test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation\r
++++ b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation\r
+@@ -109,12 +109,14 @@ http://notmuchmail.org/mailman/listinfo/notmuch\r
+           To: notmuch@notmuchmail.org\r
+           Date: Wed, 18 Nov 2009 02:50:48 +0600\r
\r
+-          Twas brillig at 15:33:01 17.11.2009 UTC-05 when lars at seas.harvard.edu\r
+-          did gyre and gimble:\r
++          Twas brillig at 15:33:01 17.11.2009 UTC-05 when lars at\r
++          seas.harvard.edu did gyre and gimble:\r
\r
+            LK> Is the list archived anywhere?  The obvious archives\r
+-           LK> (http://notmuchmail.org/pipermail/notmuch/) aren't available, and I\r
+-           LK> think I subscribed too late to get the patch (I only just saw the\r
++           LK> (http://notmuchmail.org/pipermail/notmuch/) aren't available,\r
++          and I\r
++           LK> think I subscribed too late to get the patch (I only just saw\r
++          the\r
+            LK> discussion about it).\r
\r
+            LK> It doesn't look like the patch is in git yet.\r
+@@ -141,7 +143,8 @@ http://notmuchmail.org/mailman/listinfo/notmuch\r
+           seas.harvard.edu> wrote:\r
+           > > See the patch just posted here.\r
\r
+-          I've also pushed a slightly more complicated (and complete) fix to my\r
++          I've also pushed a slightly more complicated (and complete) fix to\r
++          my\r
+           private notmuch repository\r
\r
+           git://keithp.com/git/notmuch\r
+@@ -164,10 +167,12 @@ http://notmuchmail.org/mailman/listinfo/notmuch\r
+               [ multipart/signed ]\r
+               [ Unknown signature status ]\r
+               [ text/plain ]\r
+-              > I've also pushed a slightly more complicated (and complete) fix to my\r
++              > I've also pushed a slightly more complicated (and complete)\r
++              > fix to my\r
+               > private notmuch repository\r
\r
+-              The version of lib/messages.cc in your repo doesn't build because it's\r
++              The version of lib/messages.cc in your repo doesn't build\r
++              because it's\r
+               missing "#include <stdint.h>" (for the uint32_t on line 466).\r
\r
+               [ 4-line signature. Click/Enter to show. ]\r
+diff --git a/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation\r
+index 62a4635..620caa0 100644\r
+--- a/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation\r
++++ b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation\r
+@@ -49,8 +49,8 @@ Date: Wed, 18 Nov 2009 01:02:38 +0600\r
+ [ Unknown signature status ]\r
+ [ text/plain ]\r
\r
+-Twas brillig at 14:00:54 17.11.2009 UTC-05 when lars@seas.harvard.edu did\r
+-gyre and gimble:\r
++Twas brillig at 14:00:54 17.11.2009 UTC-05 when lars@seas.harvard.edu did gyre\r
++and gimble:\r
\r
+  LK> Resulted in 4604 lines of errors along the lines of:\r
\r
+@@ -109,8 +109,8 @@ Subject: [notmuch] Working with Maildir storage?\r
+ To: notmuch@notmuchmail.org\r
+ Date: Wed, 18 Nov 2009 02:50:48 +0600\r
\r
+-Twas brillig at 15:33:01 17.11.2009 UTC-05 when lars at seas.harvard.edu\r
+-did gyre and gimble:\r
++Twas brillig at 15:33:01 17.11.2009 UTC-05 when lars at seas.harvard.edu did\r
++gyre and gimble:\r
\r
+  LK> Is the list archived anywhere?  The obvious archives\r
+  LK> (http://notmuchmail.org/pipermail/notmuch/) aren't available, and I\r
+-- \r
+2.1.4\r
+\r