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 AB409431FC0
\r
6 for <notmuch@notmuchmail.org>; Tue, 7 Aug 2012 09:08:57 -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 qRljlw5DCpLR for <notmuch@notmuchmail.org>;
\r
16 Tue, 7 Aug 2012 09:08:57 -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 EF63F431FAF
\r
19 for <notmuch@notmuchmail.org>; Tue, 7 Aug 2012 09:08:56 -0700 (PDT)
\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)
\r
21 id A474E1002A4; Tue, 7 Aug 2012 19:09:05 +0300 (EEST)
\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
23 To: Mark Walters <markwalters1009@gmail.com>,
\r
24 Austin Clements <amdragon@MIT.EDU>
\r
25 Subject: Re: [PATCH] emacs: notmuch search bugfix
\r
26 In-Reply-To: <87pq72bthc.fsf@qmul.ac.uk>
\r
27 References: <87boinpqfg.fsf@qmul.ac.uk> <20120806234732.GM22601@mit.edu>
\r
28 <87pq72bthc.fsf@qmul.ac.uk>
\r
29 User-Agent: Notmuch/0.13.2+128~g07453d8 (http://notmuchmail.org) Emacs/23.1.1
\r
30 (x86_64-redhat-linux-gnu)
\r
31 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
32 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
33 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
34 Date: Tue, 07 Aug 2012 19:09:05 +0300
\r
35 Message-ID: <m2boimofa6.fsf@guru.guru-group.fi>
\r
37 Content-Type: text/plain; charset=us-ascii
\r
38 Cc: notmuch@notmuchmail.org
\r
39 X-BeenThere: notmuch@notmuchmail.org
\r
40 X-Mailman-Version: 2.1.13
\r
42 List-Id: "Use and development of the notmuch mail system."
\r
43 <notmuch.notmuchmail.org>
\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
45 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
47 List-Post: <mailto:notmuch@notmuchmail.org>
\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
50 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
51 X-List-Received-Date: Tue, 07 Aug 2012 16:08:57 -0000
\r
53 On Tue, Aug 07 2012, Mark Walters wrote:
\r
55 > The recent change to use json for notmuch-search.el introduced a bug
\r
56 > in the code for keeping position on refresh. The problem is a
\r
57 > comparison between (plist-get result :thread) and a thread-id returned
\r
58 > by notmuch-search-find-thread-id: the latter is prefixed with
\r
61 > We fix this by adding an option to notmuch-search-find-thread-id to
\r
62 > return the bare thread-id. It appears that notmuch-search-refresh-view
\r
63 > is the only caller of notmuch-search that supplies a thread-id so this
\r
64 > change should be safe (but could theoretically break users .emacs
\r
68 > This is a different version of the bugfix suggested in the parent to
\r
69 > this thread. I think it is nicer but there is a slight risk of breaking
\r
70 > users .emacs lisp functions.
\r
72 > In general I think the thread: prefix should be present where the term
\r
73 > is "really" a search term, but absent when it is must be a thread-id,
\r
74 > and this fits with that idea.
\r
76 > With 0.14 freeze pretty close it might be best to apply this to master
\r
77 > and the simpler no breakage option (in id:"87boinpqfg.fsf@qmul.ac.uk")
\r
82 IMHO you're too shy with this patch to be included in 0.14 :D
\r
83 -- at least I cannot imagine a case this would fail...
\r
85 My change would have been:
\r
86 (when thread (if bare thread (concat "thread:" thread)))
\r
88 or even (which changes irrelevant part):
\r
89 (if thread (if bare thread (concat "thread:" thread)))
\r
91 Anyway, this is good as it is "in the grand scheme of things".
\r
100 > emacs/notmuch.el | 10 ++++++----
\r
101 > 1 files changed, 6 insertions(+), 4 deletions(-)
\r
103 > diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
104 > index d2d82a9..0fff58a 100644
\r
105 > --- a/emacs/notmuch.el
\r
106 > +++ b/emacs/notmuch.el
\r
107 > @@ -475,10 +475,12 @@ BEG."
\r
108 > (push (plist-get (notmuch-search-get-result pos) property) output)))
\r
111 > -(defun notmuch-search-find-thread-id ()
\r
112 > - "Return the thread for the current thread"
\r
113 > +(defun notmuch-search-find-thread-id (&optional bare)
\r
114 > + "Return the thread for the current thread
\r
116 > +If BARE is set then do not prefix with \"thread:\""
\r
117 > (let ((thread (plist-get (notmuch-search-get-result) :thread)))
\r
118 > - (when thread (concat "thread:" thread))))
\r
119 > + (when thread (concat (when (not bare) "thread:") thread))))
\r
121 > (defun notmuch-search-find-thread-id-region (beg end)
\r
122 > "Return a list of threads for the current region"
\r
123 > @@ -993,7 +995,7 @@ same relative position within the new buffer."
\r
125 > (let ((target-line (line-number-at-pos))
\r
126 > (oldest-first notmuch-search-oldest-first)
\r
127 > - (target-thread (notmuch-search-find-thread-id))
\r
128 > + (target-thread (notmuch-search-find-thread-id t))
\r
129 > (query notmuch-search-query-string)
\r
130 > (continuation notmuch-search-continuation))
\r
131 > (notmuch-kill-this-buffer)
\r
135 > _______________________________________________
\r
136 > notmuch mailing list
\r
137 > notmuch@notmuchmail.org
\r
138 > http://notmuchmail.org/mailman/listinfo/notmuch
\r