Re: (emacs) Parsing problems replying to encrypted html
[notmuch-archives.git] / c2 / efac579cf03c2d52e7ebe94eb62637f45fad5c
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 AE1CE431FB6\r
6         for <notmuch@notmuchmail.org>; Wed,  4 Jul 2012 09:17:15 -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 DASSV8SpTi9h for <notmuch@notmuchmail.org>;\r
16         Wed,  4 Jul 2012 09:17:15 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU\r
18         [18.7.68.36])\r
19         by olra.theworths.org (Postfix) with ESMTP id B539E431FAE\r
20         for <notmuch@notmuchmail.org>; Wed,  4 Jul 2012 09:17:14 -0700 (PDT)\r
21 X-AuditID: 12074424-b7f2a6d0000008bf-67-4ff46c8808cc\r
22 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
23         by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id A7.FD.02239.88C64FF4; Wed,  4 Jul 2012 12:17:12 -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 q64GHBa9025847; \r
27         Wed, 4 Jul 2012 12:17:11 -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 q64GH96i005569\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Wed, 4 Jul 2012 12:17:10 -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 1SmSGK-0000CO-RW; Wed, 04 Jul 2012 12:17:08 -0400\r
37 Date: Wed, 4 Jul 2012 12:17:08 -0400\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: Mark Walters <markwalters1009@gmail.com>\r
40 Subject: Re: [PATCH 3/8] emacs: Move search-target logic to\r
41         `notmuch-search-show-result'\r
42 Message-ID: <20120704161708.GB21653@mit.edu>\r
43 References: <1341354059-29396-1-git-send-email-amdragon@mit.edu>\r
44         <1341354059-29396-4-git-send-email-amdragon@mit.edu>\r
45         <87hatnhqm6.fsf@qmul.ac.uk>\r
46 MIME-Version: 1.0\r
47 Content-Type: text/plain; charset=us-ascii\r
48 Content-Disposition: inline\r
49 In-Reply-To: <87hatnhqm6.fsf@qmul.ac.uk>\r
50 User-Agent: Mutt/1.5.21 (2010-09-15)\r
51 X-Brightmail-Tracker:\r
52  H4sIAAAAAAAAA+NgFprOKsWRmVeSWpSXmKPExsUixCmqrduR88XfYNthbovVc3ksrt+cyWzx\r
53         ZuU8Vgdmj52z7rJ7HP66kMXj2apbzAHMUVw2Kak5mWWpRfp2CVwZLdNOMxa8Va5Yv/YXUwPj\r
54         D+kuRk4OCQETiVuf97NC2GISF+6tZwOxhQT2MUrseenXxcgFZK9nlLjctIQZInGCSeL7XEaI\r
55         xBJGicNLJ7N0MXJwsAioSBx9pwJSwyagIbFt/3JGEFtEQEfi9qEF7CA2s4C+xMqTM8HmCAtE\r
56         SZxZBDGTF6jmzd2DUDOnMkqs7Z7HBJEQlDg58wkLRLOWxI1/L5lAdjELSEss/8cBEuYE2nXl\r
57         3lGwclGgE6ac3MY2gVFoFpLuWUi6ZyF0L2BkXsUom5JbpZubmJlTnJqsW5ycmJeXWqRrrpeb\r
58         WaKXmlK6iREU5uwuKjsYmw8pHWIU4GBU4uFNVPjsL8SaWFZcmXuIUZKDSUmUd1PWF38hvqT8\r
59         lMqMxOKM+KLSnNTiQ4wSHMxKIrz24UA53pTEyqrUonyYlDQHi5I47/WUm/5CAumJJanZqakF\r
60         qUUwWRkODiUJ3g/ZQI2CRanpqRVpmTklCGkmDk6Q4TxAw9+C1PAWFyTmFmemQ+RPMepyrHtz\r
61         5AajEEtefl6qlDjvO5AiAZCijNI8uDmw9PSKURzoLWHeyyBVPMDUBjfpFdASJqAleYs/gSwp\r
62         SURISTUwsjVK1nlZuzdZLxe/dutkv3YQY9SqWqd7pYmGF1j4avcd91lcKmUftePa3JZTFxSO\r
63         ByyTelx4PvV+cx//vnPvuuSuiehrCSk9VBbcOtNgWubxZTHfPi9f0rac+wjbGwWZxEdnJh86\r
64         vZNpHauqzBwPAyfL0kdnp76OsFzyJDKuNG7lfsfmN6LHlFiKMxINtZiLihMBXpKsuioDAAA=\r
65 Cc: tomi.ollila@iki.fi, notmuch@notmuchmail.org\r
66 X-BeenThere: notmuch@notmuchmail.org\r
67 X-Mailman-Version: 2.1.13\r
68 Precedence: list\r
69 List-Id: "Use and development of the notmuch mail system."\r
70         <notmuch.notmuchmail.org>\r
71 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
72         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
73 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
74 List-Post: <mailto:notmuch@notmuchmail.org>\r
75 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
76 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
77         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
78 X-List-Received-Date: Wed, 04 Jul 2012 16:17:15 -0000\r
79 \r
80 Quoth Mark Walters on Jul 04 at  9:34 am:\r
81 > On Tue, 03 Jul 2012, Austin Clements <amdragon@MIT.EDU> wrote:\r
82 > > This is a simpler place to do this, since we can avoid any point\r
83 > > motion and hence any save-excursions in\r
84 > > `notmuch-search-process-filter', which in turn lets us put all of the\r
85 > > search-target logic outside of any save-excursions.\r
86 > >\r
87 > > `notmuch-search-process-filter' could use some reindentation after\r
88 > > this, but we're about to rewrite it entirely, so we won't bother.\r
89 > > ---\r
90 > >  emacs/notmuch.el |   33 +++++++++++++++------------------\r
91 > >  1 file changed, 15 insertions(+), 18 deletions(-)\r
92 > >\r
93 > > diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
94 > > index dadc6d6..4a6490a 100644\r
95 > > --- a/emacs/notmuch.el\r
96 > > +++ b/emacs/notmuch.el\r
97 > > @@ -729,24 +729,27 @@ non-authors is found, assume that all of the authors match."\r
98 > >  (defun notmuch-search-show-result (thread-id date count authors subject tags)\r
99 > >    ;; Ignore excluded matches\r
100 > >    (unless (eq (aref count 1) ?0)\r
101 > > -    (let ((beg (point))\r
102 > > +    (let ((beg (point-max))\r
103 > >       (tags-str (mapconcat 'identity tags " ")))\r
104 > > -      (dolist (format notmuch-search-result-format)\r
105 > > -   (notmuch-search-insert-field (car format) (cdr format)\r
106 > > -                                date count authors subject tags-str))\r
107 > > -      (insert "\n")\r
108 > > -      (notmuch-search-color-line beg (point) tags)\r
109 > > -      (put-text-property beg (point) 'notmuch-search-thread-id thread-id)\r
110 > > -      (put-text-property beg (point) 'notmuch-search-authors authors)\r
111 > > -      (put-text-property beg (point) 'notmuch-search-subject subject))))\r
112 > > +      (save-excursion\r
113 > > +   (goto-char beg)\r
114 > > +   (dolist (format notmuch-search-result-format)\r
115 > > +     (notmuch-search-insert-field (car format) (cdr format)\r
116 > > +                                  date count authors subject tags-str))\r
117 > > +   (insert "\n")\r
118 > > +   (notmuch-search-color-line beg (point) tags)\r
119 > > +   (put-text-property beg (point) 'notmuch-search-thread-id thread-id)\r
120 > > +   (put-text-property beg (point) 'notmuch-search-authors authors)\r
121 > > +   (put-text-property beg (point) 'notmuch-search-subject subject))\r
122 > > +      (when (string= thread-id notmuch-search-target-thread)\r
123 > > +   (setq notmuch-search-target-thread "found")\r
124 > > +   (goto-char beg)))))\r
125 > >  \r
126 > >  (defun notmuch-search-process-filter (proc string)\r
127 > >    "Process and filter the output of \"notmuch search\""\r
128 > > -  (let ((buffer (process-buffer proc))\r
129 > > -   (found-target nil))\r
130 > > +  (let ((buffer (process-buffer proc)))\r
131 > >      (if (buffer-live-p buffer)\r
132 > >     (with-current-buffer buffer\r
133 > > -     (save-excursion\r
134 > >         (let ((line 0)\r
135 > >               (more t)\r
136 > >               (inhibit-read-only t)\r
137 > > @@ -763,12 +766,8 @@ non-authors is found, assume that all of the authors match."\r
138 > >                        (subject (match-string 5 string))\r
139 > >                        (tags (match-string 6 string))\r
140 > >                        (tag-list (if tags (save-match-data (split-string tags)))))\r
141 > > -                 (goto-char (point-max))\r
142 > >                   (if (/= (match-beginning 1) line)\r
143 > >                       (insert (concat "Error: Unexpected output from notmuch search:\n" (substring string line (match-beginning 1)) "\n")))\r
144\r
145 > Does this mean that error information now comes just before the matching\r
146 > thread, rather than at the place in the thread list the error actually\r
147 > occurs? This is not a complaint: just everything else looks like it is\r
148 > functionally equivalent. (Maybe it is all made irrelevant by a later\r
149 > patch anyway).\r
150 \r
151 In fact, the errors will appear before the first message *until* you\r
152 reach the matched message.  I think this was the result of overzealous\r
153 rebasing.  I'm happy to fix it here for posterity (possibly by\r
154 swapping this and the next patch), though as you point out the next\r
155 patch in the series also fixes it, so I'm also happy to leave it\r
156 alone.\r
157 \r
158 > Best wishes\r
159\r
160 > Mark\r
161\r
162\r
163 > > -                 (when (string= thread-id notmuch-search-target-thread)\r
164 > > -                   (set 'found-target (point))\r
165 > > -                   (set 'notmuch-search-target-thread "found"))\r
166 > >                   (notmuch-search-show-result thread-id date count authors subject tag-list)\r
167 > >                   (set 'line (match-end 0)))\r
168 > >               (set 'more nil)\r
169 > > @@ -777,8 +776,6 @@ non-authors is found, assume that all of the authors match."\r
170 > >               (if (< line (length string))\r
171 > >                   (setq notmuch-search-process-filter-data (substring string line)))\r
172 > >               ))))\r
173 > > -     (if found-target\r
174 > > -         (goto-char found-target)))\r
175 > >        (delete-process proc))))\r
176 > >  \r
177 > >  (defun notmuch-search-tag-all (&optional tag-changes)\r