[PATCH] contrib: pick: unset current-prefix-arg for notmuch-show
authorMark Walters <markwalters1009@gmail.com>
Wed, 2 Oct 2013 12:59:48 +0000 (13:59 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:57:13 +0000 (09:57 -0800)
78/917368ca9cfad2473b9c99d4070d3f9a60f142 [new file with mode: 0644]

diff --git a/78/917368ca9cfad2473b9c99d4070d3f9a60f142 b/78/917368ca9cfad2473b9c99d4070d3f9a60f142
new file mode 100644 (file)
index 0000000..52738f2
--- /dev/null
@@ -0,0 +1,114 @@
+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 olra.theworths.org (Postfix) with ESMTP id E2A4D431FD2\r
+       for <notmuch@notmuchmail.org>; Wed,  2 Oct 2013 06:00:05 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id aRDfh13T4SRY for <notmuch@notmuchmail.org>;\r
+       Wed,  2 Oct 2013 06:00:00 -0700 (PDT)\r
+Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com\r
+ [74.125.82.46])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 39A46431FCF   for <notmuch@notmuchmail.org>; Wed,  2 Oct 2013 06:00:00 -0700\r
+ (PDT)\r
+Received: by mail-wg0-f46.google.com with SMTP id k14so828487wgh.25\r
+       for <notmuch@notmuchmail.org>; Wed, 02 Oct 2013 05:59:57 -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=Rsc7MwRIParoQm4AAA4avKR+S1HARV7HkA952arArQA=;\r
+       b=h9Zi+G5uJb/v+J8F6CvIy5InpdRBBSt/8u/mybsYiKhHu9E7YTGiJPdB9HsTnuSNK7\r
+       1cJLViogp7x99OEuT/52Jb9enrp3g+uEcUINZ9AouQIThMKhwnjHEvaZsZkcPBSB9BzX\r
+       vW7glDBS+NgknLe4XLEp5Ovam/DLmIqhmtCaKGTP5q93bthC3flSWVUrOp27h0TD85nl\r
+       Mv1tEHbQWiw8ixnmlGvncCRCcmw57nq18Xkv+rsq3OFZvTVBS4EEA/trqH6LZarh+Jyu\r
+       zLZRH+w8W6hj5FoK3DQ7Vh6zwajWkzYG3pZ9JBANo2/QmlcLEt7VwKAjy+8NwLhUx9t6\r
+       RIOA==\r
+X-Received: by 10.180.73.113 with SMTP id k17mr23241346wiv.6.1380718797490;\r
+       Wed, 02 Oct 2013 05:59:57 -0700 (PDT)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+       by mx.google.com with ESMTPSA id i8sm3353623wib.1.1969.12.31.16.00.00\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Wed, 02 Oct 2013 05:59:57 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] contrib: pick: unset current-prefix-arg for notmuch-show\r
+Date: Wed,  2 Oct 2013 13:59:48 +0100\r
+Message-Id: <1380718788-18165-1-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://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: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 02 Oct 2013 13:00:06 -0000\r
+\r
+notmuch-show looks at the prefix argument directly (ie via\r
+current-prefix-arg) rather than using some form of the interactive\r
+command. Thus we need to unset current-prefix-arg before calling notmuch-show.\r
+---\r
+I was just doing final tests for pick to mainline when I discovered\r
+the following bug. The show-out option was not working quite correctly\r
+(it was eliding the non-matching messages). I traced this to the\r
+following: notmuch-show looks at current-prefix-arg directly. The\r
+recent change to call notmuch-pick-show-message-out via a prefix arg\r
+rather than its own keybinding meant that this prefix arg is being\r
+passed on to the subsidary notmuch-show call. \r
+\r
+To avoid this we unset current-prefix-arg before calling\r
+notmuch-show. It seems neatest to do this in\r
+notmuch-pick-show-message.\r
+\r
+Sorry for not spotting this before.\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+\r
+\r
+\r
+\r
+ contrib/notmuch-pick/notmuch-pick.el |   11 +++++++----\r
+ 1 files changed, 7 insertions(+), 4 deletions(-)\r
+\r
+diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el\r
+index 0aa651e..6b727b2 100644\r
+--- a/contrib/notmuch-pick/notmuch-pick.el\r
++++ b/contrib/notmuch-pick/notmuch-pick.el\r
+@@ -488,10 +488,13 @@ Does NOT change the database."\r
+ Shows in split pane or whole window according to value of\r
+ `notmuch-pick-show-out'. A prefix argument reverses the choice."\r
+   (interactive "P")\r
+-  (if (or (and notmuch-pick-show-out  (not arg))\r
+-        (and (not notmuch-pick-show-out) arg))\r
+-      (notmuch-pick-show-message-out)\r
+-    (notmuch-pick-show-message-in)))\r
++  ;; We have to unset current-prefix-arg as notmuch-show examines it\r
++  ;; directly.\r
++  (let ((current-prefix-arg nil))\r
++    (if (or (and notmuch-pick-show-out (not arg))\r
++          (and (not notmuch-pick-show-out) arg))\r
++      (notmuch-pick-show-message-out)\r
++      (notmuch-pick-show-message-in))))\r
\r
+ (defun notmuch-pick-scroll-message-window ()\r
+   "Scroll the message window (if it exists)"\r
+-- \r
+1.7.9.1\r
+\r