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