[PATCH] emacs: wash: make word-wrap bound message width
authorMark Walters <markwalters1009@gmail.com>
Wed, 6 Jul 2016 07:47:31 +0000 (08:47 +0100)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 23:22:10 +0000 (16:22 -0700)
4f/38002da6b3469d2aeff1fb8b48661699749b97 [new file with mode: 0644]

diff --git a/4f/38002da6b3469d2aeff1fb8b48661699749b97 b/4f/38002da6b3469d2aeff1fb8b48661699749b97
new file mode 100644 (file)
index 0000000..6e621bf
--- /dev/null
@@ -0,0 +1,121 @@
+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 D11A16DE015B\r
+ for <notmuch@notmuchmail.org>; Wed,  6 Jul 2016 00:47:49 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.344\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.344 tagged_above=-999 required=5 tests=[AWL=0.226,\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 vFn3eykN72WB for <notmuch@notmuchmail.org>;\r
+ Wed,  6 Jul 2016 00:47:41 -0700 (PDT)\r
+Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com\r
+ [74.125.82.43]) by arlo.cworth.org (Postfix) with ESMTPS id 72F416DE0008 for\r
+ <notmuch@notmuchmail.org>; Wed,  6 Jul 2016 00:47:41 -0700 (PDT)\r
+Received: by mail-wm0-f43.google.com with SMTP id 187so30870160wmz.1\r
+ for <notmuch@notmuchmail.org>; Wed, 06 Jul 2016 00:47:41 -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;\r
+ bh=ySoBJAQY3xRoYEjVYDISQ//OFXODpaK+fWbYDq5oBRc=;\r
+ b=WRWv5zSqMbfBuUIWm/fzPyikIAxq/hK28l+tJAjetrzrxnMPS1dpeJTrsMfXzoTQTB\r
+ S/k30YKdDFJ8WR5Cv2damxfVTh5XX7m4nNXGqU57cWEwLR/zfuZE5y2MCmVKkY9gdMOS\r
+ ctnhJRo9ViaIX+LAk6MFzOty/PsEtkFyskZiifYyCUD426szddng9VWTEepydFk2n3uh\r
+ KRE4iD+UPFEtv+nxWZ5uI2COMDDj8IhVtt4cFn6n+NsIlZaZ9YLYYFLPFGg7JnDwA4CP\r
+ JSCvsaCRC8orgHHEqKJO0jHiu7Uoi6+z9uS9tSZ4aMNgM388WQSfI/h40Jh5GHMRblaf\r
+ +PWg==\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;\r
+ bh=ySoBJAQY3xRoYEjVYDISQ//OFXODpaK+fWbYDq5oBRc=;\r
+ b=FqlnI0p91poxPqJdbaO0D0B5EfB+yc+ipXigsvmliqyh5utX+Q4fPHJltlXDLxaDVW\r
+ 93GHb2xiz6OrhDeGdOm34YPHHegerEp0LPk2lHuJ/K9wYkKoyV8ykcNFg4ABhtbK8UBX\r
+ HojuDz8hngBtsCZ3K7o3s3xeELv87Lnx4d0wHAo6RsdB1ake8O/mr3gafqpPDgpK9IJv\r
+ oPXb1QtZeBcbtKHY+D/xEOR7VT4kr4v23z6sMvHj2s7Nntrewl2pCuI/9JrDYgYs3EcO\r
+ VcS2IZkJgpsEIt9m5GuxQ1hD6MWYtlOwrM74hYvEkD09IrxL4XPwVaBhOooOZ+gpOcgH\r
+ g+Xg==\r
+X-Gm-Message-State:\r
+ ALyK8tJ+8WcW0xEzH8IFwJdqvgILgmZzMFI7mepZOo4hP/xagPzkGysescas9gk97nZFdw==\r
+X-Received: by 10.28.10.196 with SMTP id 187mr20900099wmk.48.1467791259321;\r
+ Wed, 06 Jul 2016 00:47:39 -0700 (PDT)\r
+Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162])\r
+ by smtp.gmail.com with ESMTPSA id d4sm882995wjb.47.2016.07.06.00.47.38\r
+ (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Wed, 06 Jul 2016 00:47:38 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: wash: make word-wrap bound message width\r
+Date: Wed,  6 Jul 2016 08:47:31 +0100\r
+Message-Id: <1467791251-6823-1-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 2.1.4\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: Wed, 06 Jul 2016 07:47:50 -0000\r
+\r
+Previously if notmuch-wash-wrap-lines-length was set then all messages\r
+would be wrapped at this value (or window-width if that is\r
+smaller). This was done regardless of the message's depth in a thread:\r
+for example, if the n.w.w.l.l is 80 and the messages depth is 20\r
+(so indented 20 by default) the messages text only got 60 characters\r
+of space.\r
+\r
+This commit changes that so a message always gets the full n.w.w.l.l\r
+of width regardless of its indentation (unless that goes over\r
+window-width of course).\r
+---\r
+\r
+This is what I would like -- I don't know if anyone would like to keep\r
+the previous behaviour as an option. The code-part for that is easy, but getting\r
+the docstrings and and defcustoms right is not clear.\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+emacs/notmuch-wash.el | 6 +++---\r
+ 1 file changed, 3 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el\r
+index 57e6dfa..e16b8cc 100644\r
+--- a/emacs/notmuch-wash.el\r
++++ b/emacs/notmuch-wash.el\r
+@@ -121,8 +121,8 @@ collapse the remaining lines into a button."\r
\r
+ If this is nil, lines in messages will be wrapped to fit in the\r
+ current window. If this is a number, lines will be wrapped after\r
+-this many characters or at the window width (whichever one is\r
+-lower)."\r
++this many characters (ignoring indentation due to thread depth)\r
++or at the window width (whichever one is lower)."\r
+   :type '(choice (const :tag "window width" nil)\r
+                (integer :tag "number of characters"))\r
+   :group 'notmuch-wash)\r
+@@ -336,7 +336,7 @@ the wrapped text are maintained."\r
\r
+   (let* ((coolj-wrap-follows-window-size nil)\r
+        (limit (if (numberp notmuch-wash-wrap-lines-length)\r
+-                  (min notmuch-wash-wrap-lines-length\r
++                  (min (+ notmuch-wash-wrap-lines-length depth)\r
+                        (window-width))\r
+                 (window-width)))\r
+        (fill-column (- limit\r
+-- \r
+2.1.4\r
+\r