1 Return-Path: <tomi.ollila@iki.fi>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 2F5D9431FD7
\r
6 for <notmuch@notmuchmail.org>; Wed, 2 Oct 2013 09:58:17 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id 8kFKvMktty5M for <notmuch@notmuchmail.org>;
\r
16 Wed, 2 Oct 2013 09:58:08 -0700 (PDT)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id CDA0F431FD6
\r
19 for <notmuch@notmuchmail.org>; Wed, 2 Oct 2013 09:58:07 -0700 (PDT)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id 0B315100033;
\r
22 Wed, 2 Oct 2013 19:57:52 +0300 (EEST)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org
\r
25 Subject: Re: [PATCH] contrib: pick: unset current-prefix-arg for notmuch-show
\r
26 In-Reply-To: <1380718788-18165-1-git-send-email-markwalters1009@gmail.com>
\r
27 References: <1380718788-18165-1-git-send-email-markwalters1009@gmail.com>
\r
28 User-Agent: Notmuch/0.16+87~g451fefe (http://notmuchmail.org) Emacs/24.3.1
\r
29 (x86_64-unknown-linux-gnu)
\r
30 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
31 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
32 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
33 Date: Wed, 02 Oct 2013 19:57:51 +0300
\r
34 Message-ID: <m2siwjhapc.fsf@guru.guru-group.fi>
\r
36 Content-Type: text/plain
\r
37 X-BeenThere: notmuch@notmuchmail.org
\r
38 X-Mailman-Version: 2.1.13
\r
40 List-Id: "Use and development of the notmuch mail system."
\r
41 <notmuch.notmuchmail.org>
\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
43 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
45 List-Post: <mailto:notmuch@notmuchmail.org>
\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
48 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
49 X-List-Received-Date: Wed, 02 Oct 2013 16:58:17 -0000
\r
51 On Wed, Oct 02 2013, Mark Walters <markwalters1009@gmail.com> wrote:
\r
53 > notmuch-show looks at the prefix argument directly (ie via
\r
54 > current-prefix-arg) rather than using some form of the interactive
\r
55 > command. Thus we need to unset current-prefix-arg before calling notmuch-show.
\r
58 Alternatively fix notmuch-show to do
\r
60 (interactive "sNotmuch show: \nP")
\r
62 and then add new argument, like `elide-toggle` or something to the
\r
65 Not considering notmuch-pick there is only one (1) call to that function,
\r
66 inside notmuch sources... soo the change there would be.
\r
68 --- a/emacs/notmuch.el
\r
69 +++ b/emacs/notmuch.el
\r
70 @@ -495 +495 @@ If BARE is set then do not prefix with \"thread:\""
\r
71 - (notmuch-show thread-id
\r
72 + (notmuch-show thread-id nil
\r
74 IMO there should not be "current-prefix-arg" side effects when calling
\r
75 notmuch-show non-interactively, yet other opinions welcome.
\r
81 > I was just doing final tests for pick to mainline when I discovered
\r
82 > the following bug. The show-out option was not working quite correctly
\r
83 > (it was eliding the non-matching messages). I traced this to the
\r
84 > following: notmuch-show looks at current-prefix-arg directly. The
\r
85 > recent change to call notmuch-pick-show-message-out via a prefix arg
\r
86 > rather than its own keybinding meant that this prefix arg is being
\r
87 > passed on to the subsidary notmuch-show call.
\r
89 > To avoid this we unset current-prefix-arg before calling
\r
90 > notmuch-show. It seems neatest to do this in
\r
91 > notmuch-pick-show-message.
\r
93 > Sorry for not spotting this before.
\r
103 > contrib/notmuch-pick/notmuch-pick.el | 11 +++++++----
\r
104 > 1 files changed, 7 insertions(+), 4 deletions(-)
\r
106 > diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el
\r
107 > index 0aa651e..6b727b2 100644
\r
108 > --- a/contrib/notmuch-pick/notmuch-pick.el
\r
109 > +++ b/contrib/notmuch-pick/notmuch-pick.el
\r
110 > @@ -488,10 +488,13 @@ Does NOT change the database."
\r
111 > Shows in split pane or whole window according to value of
\r
112 > `notmuch-pick-show-out'. A prefix argument reverses the choice."
\r
113 > (interactive "P")
\r
114 > - (if (or (and notmuch-pick-show-out (not arg))
\r
115 > - (and (not notmuch-pick-show-out) arg))
\r
116 > - (notmuch-pick-show-message-out)
\r
117 > - (notmuch-pick-show-message-in)))
\r
118 > + ;; We have to unset current-prefix-arg as notmuch-show examines it
\r
120 > + (let ((current-prefix-arg nil))
\r
121 > + (if (or (and notmuch-pick-show-out (not arg))
\r
122 > + (and (not notmuch-pick-show-out) arg))
\r
123 > + (notmuch-pick-show-message-out)
\r
124 > + (notmuch-pick-show-message-in))))
\r
126 > (defun notmuch-pick-scroll-message-window ()
\r
127 > "Scroll the message window (if it exists)"
\r
131 > _______________________________________________
\r
132 > notmuch mailing list
\r
133 > notmuch@notmuchmail.org
\r
134 > http://notmuchmail.org/mailman/listinfo/notmuch
\r