--- /dev/null
+Return-Path: <amdragon@mit.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id AE1CE431FB6\r
+ for <notmuch@notmuchmail.org>; Wed, 4 Jul 2012 09:17:15 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id DASSV8SpTi9h for <notmuch@notmuchmail.org>;\r
+ Wed, 4 Jul 2012 09:17:15 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU\r
+ [18.7.68.36])\r
+ by olra.theworths.org (Postfix) with ESMTP id B539E431FAE\r
+ for <notmuch@notmuchmail.org>; Wed, 4 Jul 2012 09:17:14 -0700 (PDT)\r
+X-AuditID: 12074424-b7f2a6d0000008bf-67-4ff46c8808cc\r
+Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
+ by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id A7.FD.02239.88C64FF4; Wed, 4 Jul 2012 12:17:12 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+ by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q64GHBa9025847; \r
+ Wed, 4 Jul 2012 12:17:11 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+ (authenticated bits=0)\r
+ (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+ by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q64GH96i005569\r
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+ Wed, 4 Jul 2012 12:17:10 -0400 (EDT)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+ (envelope-from <amdragon@MIT.EDU>)\r
+ id 1SmSGK-0000CO-RW; Wed, 04 Jul 2012 12:17:08 -0400\r
+Date: Wed, 4 Jul 2012 12:17:08 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Mark Walters <markwalters1009@gmail.com>\r
+Subject: Re: [PATCH 3/8] emacs: Move search-target logic to\r
+ `notmuch-search-show-result'\r
+Message-ID: <20120704161708.GB21653@mit.edu>\r
+References: <1341354059-29396-1-git-send-email-amdragon@mit.edu>\r
+ <1341354059-29396-4-git-send-email-amdragon@mit.edu>\r
+ <87hatnhqm6.fsf@qmul.ac.uk>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <87hatnhqm6.fsf@qmul.ac.uk>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFprOKsWRmVeSWpSXmKPExsUixCmqrduR88XfYNthbovVc3ksrt+cyWzx\r
+ ZuU8Vgdmj52z7rJ7HP66kMXj2apbzAHMUVw2Kak5mWWpRfp2CVwZLdNOMxa8Va5Yv/YXUwPj\r
+ D+kuRk4OCQETiVuf97NC2GISF+6tZwOxhQT2MUrseenXxcgFZK9nlLjctIQZInGCSeL7XEaI\r
+ xBJGicNLJ7N0MXJwsAioSBx9pwJSwyagIbFt/3JGEFtEQEfi9qEF7CA2s4C+xMqTM8HmCAtE\r
+ SZxZBDGTF6jmzd2DUDOnMkqs7Z7HBJEQlDg58wkLRLOWxI1/L5lAdjELSEss/8cBEuYE2nXl\r
+ 3lGwclGgE6ac3MY2gVFoFpLuWUi6ZyF0L2BkXsUom5JbpZubmJlTnJqsW5ycmJeXWqRrrpeb\r
+ WaKXmlK6iREU5uwuKjsYmw8pHWIU4GBU4uFNVPjsL8SaWFZcmXuIUZKDSUmUd1PWF38hvqT8\r
+ lMqMxOKM+KLSnNTiQ4wSHMxKIrz24UA53pTEyqrUonyYlDQHi5I47/WUm/5CAumJJanZqakF\r
+ qUUwWRkODiUJ3g/ZQI2CRanpqRVpmTklCGkmDk6Q4TxAw9+C1PAWFyTmFmemQ+RPMepyrHtz\r
+ 5AajEEtefl6qlDjvO5AiAZCijNI8uDmw9PSKURzoLWHeyyBVPMDUBjfpFdASJqAleYs/gSwp\r
+ SURISTUwsjVK1nlZuzdZLxe/dutkv3YQY9SqWqd7pYmGF1j4avcd91lcKmUftePa3JZTFxSO\r
+ ByyTelx4PvV+cx//vnPvuuSuiehrCSk9VBbcOtNgWubxZTHfPi9f0rac+wjbGwWZxEdnJh86\r
+ vZNpHauqzBwPAyfL0kdnp76OsFzyJDKuNG7lfsfmN6LHlFiKMxINtZiLihMBXpKsuioDAAA=\r
+Cc: tomi.ollila@iki.fi, notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 04 Jul 2012 16:17:15 -0000\r
+\r
+Quoth Mark Walters on Jul 04 at 9:34 am:\r
+> On Tue, 03 Jul 2012, Austin Clements <amdragon@MIT.EDU> wrote:\r
+> > This is a simpler place to do this, since we can avoid any point\r
+> > motion and hence any save-excursions in\r
+> > `notmuch-search-process-filter', which in turn lets us put all of the\r
+> > search-target logic outside of any save-excursions.\r
+> >\r
+> > `notmuch-search-process-filter' could use some reindentation after\r
+> > this, but we're about to rewrite it entirely, so we won't bother.\r
+> > ---\r
+> > emacs/notmuch.el | 33 +++++++++++++++------------------\r
+> > 1 file changed, 15 insertions(+), 18 deletions(-)\r
+> >\r
+> > diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+> > index dadc6d6..4a6490a 100644\r
+> > --- a/emacs/notmuch.el\r
+> > +++ b/emacs/notmuch.el\r
+> > @@ -729,24 +729,27 @@ non-authors is found, assume that all of the authors match."\r
+> > (defun notmuch-search-show-result (thread-id date count authors subject tags)\r
+> > ;; Ignore excluded matches\r
+> > (unless (eq (aref count 1) ?0)\r
+> > - (let ((beg (point))\r
+> > + (let ((beg (point-max))\r
+> > (tags-str (mapconcat 'identity tags " ")))\r
+> > - (dolist (format notmuch-search-result-format)\r
+> > - (notmuch-search-insert-field (car format) (cdr format)\r
+> > - date count authors subject tags-str))\r
+> > - (insert "\n")\r
+> > - (notmuch-search-color-line beg (point) tags)\r
+> > - (put-text-property beg (point) 'notmuch-search-thread-id thread-id)\r
+> > - (put-text-property beg (point) 'notmuch-search-authors authors)\r
+> > - (put-text-property beg (point) 'notmuch-search-subject subject))))\r
+> > + (save-excursion\r
+> > + (goto-char beg)\r
+> > + (dolist (format notmuch-search-result-format)\r
+> > + (notmuch-search-insert-field (car format) (cdr format)\r
+> > + date count authors subject tags-str))\r
+> > + (insert "\n")\r
+> > + (notmuch-search-color-line beg (point) tags)\r
+> > + (put-text-property beg (point) 'notmuch-search-thread-id thread-id)\r
+> > + (put-text-property beg (point) 'notmuch-search-authors authors)\r
+> > + (put-text-property beg (point) 'notmuch-search-subject subject))\r
+> > + (when (string= thread-id notmuch-search-target-thread)\r
+> > + (setq notmuch-search-target-thread "found")\r
+> > + (goto-char beg)))))\r
+> > \r
+> > (defun notmuch-search-process-filter (proc string)\r
+> > "Process and filter the output of \"notmuch search\""\r
+> > - (let ((buffer (process-buffer proc))\r
+> > - (found-target nil))\r
+> > + (let ((buffer (process-buffer proc)))\r
+> > (if (buffer-live-p buffer)\r
+> > (with-current-buffer buffer\r
+> > - (save-excursion\r
+> > (let ((line 0)\r
+> > (more t)\r
+> > (inhibit-read-only t)\r
+> > @@ -763,12 +766,8 @@ non-authors is found, assume that all of the authors match."\r
+> > (subject (match-string 5 string))\r
+> > (tags (match-string 6 string))\r
+> > (tag-list (if tags (save-match-data (split-string tags)))))\r
+> > - (goto-char (point-max))\r
+> > (if (/= (match-beginning 1) line)\r
+> > (insert (concat "Error: Unexpected output from notmuch search:\n" (substring string line (match-beginning 1)) "\n")))\r
+> \r
+> Does this mean that error information now comes just before the matching\r
+> thread, rather than at the place in the thread list the error actually\r
+> occurs? This is not a complaint: just everything else looks like it is\r
+> functionally equivalent. (Maybe it is all made irrelevant by a later\r
+> patch anyway).\r
+\r
+In fact, the errors will appear before the first message *until* you\r
+reach the matched message. I think this was the result of overzealous\r
+rebasing. I'm happy to fix it here for posterity (possibly by\r
+swapping this and the next patch), though as you point out the next\r
+patch in the series also fixes it, so I'm also happy to leave it\r
+alone.\r
+\r
+> Best wishes\r
+> \r
+> Mark\r
+> \r
+> \r
+> > - (when (string= thread-id notmuch-search-target-thread)\r
+> > - (set 'found-target (point))\r
+> > - (set 'notmuch-search-target-thread "found"))\r
+> > (notmuch-search-show-result thread-id date count authors subject tag-list)\r
+> > (set 'line (match-end 0)))\r
+> > (set 'more nil)\r
+> > @@ -777,8 +776,6 @@ non-authors is found, assume that all of the authors match."\r
+> > (if (< line (length string))\r
+> > (setq notmuch-search-process-filter-data (substring string line)))\r
+> > ))))\r
+> > - (if found-target\r
+> > - (goto-char found-target)))\r
+> > (delete-process proc))))\r
+> > \r
+> > (defun notmuch-search-tag-all (&optional tag-changes)\r