From 5c9adabc1f316e62751b0aa65f0ea86ebfcaccc3 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Wed, 2 Oct 2013 19:57:51 +0300 Subject: [PATCH] Re: [PATCH] contrib: pick: unset current-prefix-arg for notmuch-show --- 56/4cb5f78536cc287e6f0352fe4865f84ed949bc | 134 ++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 56/4cb5f78536cc287e6f0352fe4865f84ed949bc diff --git a/56/4cb5f78536cc287e6f0352fe4865f84ed949bc b/56/4cb5f78536cc287e6f0352fe4865f84ed949bc new file mode 100644 index 000000000..744cf1c8e --- /dev/null +++ b/56/4cb5f78536cc287e6f0352fe4865f84ed949bc @@ -0,0 +1,134 @@ +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 2F5D9431FD7 + for ; Wed, 2 Oct 2013 09:58:17 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + 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 8kFKvMktty5M for ; + Wed, 2 Oct 2013 09:58:08 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id CDA0F431FD6 + for ; Wed, 2 Oct 2013 09:58:07 -0700 (PDT) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 0B315100033; + Wed, 2 Oct 2013 19:57:52 +0300 (EEST) +From: Tomi Ollila +To: Mark Walters , notmuch@notmuchmail.org +Subject: Re: [PATCH] contrib: pick: unset current-prefix-arg for notmuch-show +In-Reply-To: <1380718788-18165-1-git-send-email-markwalters1009@gmail.com> +References: <1380718788-18165-1-git-send-email-markwalters1009@gmail.com> +User-Agent: Notmuch/0.16+87~g451fefe (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +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 16:58:17 -0000 + +On Wed, Oct 02 2013, Mark Walters wrote: + +> 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. +> --- + +Alternatively fix notmuch-show to do + +(interactive "sNotmuch show: \nP") + +and then add new argument, like `elide-toggle` or something to the +function. + +Not considering notmuch-pick there is only one (1) call to that function, +inside notmuch sources... soo the change there would be. + +--- a/emacs/notmuch.el ++++ b/emacs/notmuch.el +@@ -495 +495 @@ If BARE is set then do not prefix with \"thread:\"" +- (notmuch-show thread-id ++ (notmuch-show thread-id nil + +IMO there should not be "current-prefix-arg" side effects when calling +notmuch-show non-interactively, yet other opinions welcome. + + +Tomi + + +> 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 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2