RE: Reply all - issue
[notmuch-archives.git] / 6b / 3972ee534210328a7c2a13148766d70b78d562
1 Return-Path: <amdragon@mit.edu>\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 52936431FAF\r
6         for <notmuch@notmuchmail.org>; Tue,  7 Aug 2012 09:03:58 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 73KH8BJ18aqs for <notmuch@notmuchmail.org>;\r
16         Tue,  7 Aug 2012 09:03:57 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU\r
18         [18.7.68.34])\r
19         by olra.theworths.org (Postfix) with ESMTP id 9964A431FC0\r
20         for <notmuch@notmuchmail.org>; Tue,  7 Aug 2012 09:03:57 -0700 (PDT)\r
21 X-AuditID: 12074422-b7f1f6d00000090b-56-50213c6b2d26\r
22 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
23         by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 4A.E6.02315.B6C31205; Tue,  7 Aug 2012 12:03:55 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q77G3soB013642; \r
27         Tue, 7 Aug 2012 12:03:55 -0400\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q77G3rS0007508\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Tue, 7 Aug 2012 12:03:54 -0400 (EDT)\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1SymG9-0002qx-6O; Tue, 07 Aug 2012 12:03:53 -0400\r
37 Date: Tue, 7 Aug 2012 12:03:52 -0400\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: Mark Walters <markwalters1009@gmail.com>\r
40 Subject: Re: [PATCH] emacs: notmuch search bugfix\r
41 Message-ID: <20120807160352.GA2811@mit.edu>\r
42 References: <87boinpqfg.fsf@qmul.ac.uk> <20120806234732.GM22601@mit.edu>\r
43         <87pq72bthc.fsf@qmul.ac.uk>\r
44 MIME-Version: 1.0\r
45 Content-Type: text/plain; charset=us-ascii\r
46 Content-Disposition: inline\r
47 In-Reply-To: <87pq72bthc.fsf@qmul.ac.uk>\r
48 User-Agent: Mutt/1.5.21 (2010-09-15)\r
49 X-Brightmail-Tracker:\r
50  H4sIAAAAAAAAA+NgFmpkleLIzCtJLcpLzFFi42IR4hTV1s22UQwweDdL0WL1XB6L6zdnMjsw\r
51         eeycdZfd49mqW8wBTFFcNimpOZllqUX6dglcGS8+HmEr+CxSsfD2TrYGxhcCXYycHBICJhKN\r
52         Ox6xQthiEhfurWfrYuTiEBLYxyix6vJZVghnPaPEnVmtTCBVQgInmCSeHJaGSCxhlFj29wYz\r
53         SIJFQEXixPTtLCA2m4CGxLb9yxlBbBEBHYnbhxawg9jMAtIS3343gw0SFjCU2NX1Emw1r4C2\r
54         xNeLj4B6OYCGZkg82mENERaUODnzCQtEq5bEjX8vmUBKQMYs/8cBEuYE2rR8EsQmUaALppzc\r
55         xjaBUWgWku5ZSLpnIXQvYGRexSibklulm5uYmVOcmqxbnJyYl5dapGuql5tZopeaUrqJERTS\r
56         7C5KOxh/HlQ6xCjAwajEw3uBSyFAiDWxrLgy9xCjJAeTkiivsbligBBfUn5KZUZicUZ8UWlO\r
57         avEhRgkOZiUR3sM7gcp5UxIrq1KL8mFS0hwsSuK811Ju+gsJpCeWpGanphakFsFkZTg4lCR4\r
58         N1kDDRUsSk1PrUjLzClBSDNxcIIM5wEavhWkhre4IDG3ODMdIn+KUVFKnHcFSEIAJJFRmgfX\r
59         C0s5rxjFgV4R5uW2AKriAaYruO5XQIOZgAZ7y8uBDC5JREhJNTCqqFYcXZ116O2BhCq/eXdS\r
60         g1/v6mWUmmgkvk4gWGTTLw1OAeFnhcxhO/e31acveO3O++2Uze7y29qtM8pXsYka+dQaO88/\r
61         WnCu/ZS0h+i/5c67Hspctmfa8HtR53Q1ZkGrl4cWhwR++tit4Dv3MWtS6IHwZ3NUnh/9PD9A\r
62         t1o7okZ5tZuOcpsSS3FGoqEWc1FxIgCc7jvXFAMAAA==\r
63 Cc: notmuch@notmuchmail.org\r
64 X-BeenThere: notmuch@notmuchmail.org\r
65 X-Mailman-Version: 2.1.13\r
66 Precedence: list\r
67 List-Id: "Use and development of the notmuch mail system."\r
68         <notmuch.notmuchmail.org>\r
69 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
70         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
71 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
72 List-Post: <mailto:notmuch@notmuchmail.org>\r
73 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
74 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
75         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
76 X-List-Received-Date: Tue, 07 Aug 2012 16:03:58 -0000\r
77 \r
78 Quoth Mark Walters on Aug 07 at  4:40 pm:\r
79\r
80 > The recent change to use json for notmuch-search.el introduced a bug\r
81 > in the code for keeping position on refresh. The problem is a\r
82 > comparison between (plist-get result :thread) and a thread-id returned\r
83 > by notmuch-search-find-thread-id: the latter is prefixed with\r
84 > "thread:"\r
85\r
86 > We fix this by adding an option to notmuch-search-find-thread-id to\r
87 > return the bare thread-id. It appears that notmuch-search-refresh-view\r
88 > is the only caller of notmuch-search that supplies a thread-id so this\r
89 > change should be safe (but could theoretically break users .emacs\r
90 > functions).\r
91 > ---\r
92\r
93 > This is a different version of the bugfix suggested in the parent to\r
94 > this thread. I think it is nicer but there is a slight risk of breaking\r
95 > users .emacs lisp functions.\r
96\r
97 > In general I think the thread: prefix should be present where the term\r
98 > is "really" a search term, but absent when it is must be a thread-id,\r
99 > and this fits with that idea.\r
100 \r
101 Agreed.\r
102 \r
103 > With 0.14 freeze pretty close it might be best to apply this to master\r
104 > and the simpler no breakage option (in id:"87boinpqfg.fsf@qmul.ac.uk")\r
105 > to the branch.\r
106\r
107 > Best wishes \r
108\r
109 > Mark\r
110\r
111 >  emacs/notmuch.el |   10 ++++++----\r
112 >  1 files changed, 6 insertions(+), 4 deletions(-)\r
113\r
114 > diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
115 > index d2d82a9..0fff58a 100644\r
116 > --- a/emacs/notmuch.el\r
117 > +++ b/emacs/notmuch.el\r
118 > @@ -475,10 +475,12 @@ BEG."\r
119 >       (push (plist-get (notmuch-search-get-result pos) property) output)))\r
120 >      output))\r
121 >  \r
122 > -(defun notmuch-search-find-thread-id ()\r
123 > -  "Return the thread for the current thread"\r
124 > +(defun notmuch-search-find-thread-id (&optional bare)\r
125 > +  "Return the thread for the current thread\r
126 > +\r
127 > +If BARE is set then do not prefix with \"thread:\""\r
128 >    (let ((thread (plist-get (notmuch-search-get-result) :thread)))\r
129 > -    (when thread (concat "thread:" thread))))\r
130 > +    (when thread (concat (when (not bare) "thread:") thread))))\r
131 \r
132 (unless bare "thread:")?\r
133 \r
134 >  \r
135 >  (defun notmuch-search-find-thread-id-region (beg end)\r
136 >    "Return a list of threads for the current region"\r
137 > @@ -993,7 +995,7 @@ same relative position within the new buffer."\r
138 >    (interactive)\r
139 >    (let ((target-line (line-number-at-pos))\r
140 >       (oldest-first notmuch-search-oldest-first)\r
141 > -     (target-thread (notmuch-search-find-thread-id))\r
142 > +     (target-thread (notmuch-search-find-thread-id t))\r
143 \r
144 Perhaps pass 'bare instead of t to make this self-documenting?\r
145 \r
146 >       (query notmuch-search-query-string)\r
147 >       (continuation notmuch-search-continuation))\r
148 >      (notmuch-kill-this-buffer)\r