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