--- /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 72F71431FAF\r
+ for <notmuch@notmuchmail.org>; Mon, 6 Aug 2012 16:47:37 -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 CM2wVPwNjHzV for <notmuch@notmuchmail.org>;\r
+ Mon, 6 Aug 2012 16:47:37 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-4.mit.edu (DMZ-MAILSEC-SCANNER-4.MIT.EDU\r
+ [18.9.25.15])\r
+ by olra.theworths.org (Postfix) with ESMTP id E4D8C431FAE\r
+ for <notmuch@notmuchmail.org>; Mon, 6 Aug 2012 16:47:36 -0700 (PDT)\r
+X-AuditID: 1209190f-b7f306d0000008b4-84-502057971a31\r
+Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
+ by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id 12.69.02228.79750205; Mon, 6 Aug 2012 19:47:35 -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 q76NlYVE000859; \r
+ Mon, 6 Aug 2012 19:47:35 -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 q76NlXxQ024087\r
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+ Mon, 6 Aug 2012 19:47:33 -0400 (EDT)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1SyX1I-0003y2-UO; Mon, 06 Aug 2012 19:47:32 -0400\r
+Date: Mon, 6 Aug 2012 19:47:32 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Mark Walters <markwalters1009@gmail.com>\r
+Subject: Re: Small bug in json-search changes\r
+Message-ID: <20120806234732.GM22601@mit.edu>\r
+References: <87boinpqfg.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: <87boinpqfg.fsf@qmul.ac.uk>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFvrPIsWRmVeSWpSXmKPExsUixCmqrTs9XCHA4NNpRYvVc3ksrt+cyezA\r
+ 5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZfzfcp+poI23YvKfzAbGw1xdjBwcEgImErMu\r
+ s3QxcgKZYhIX7q1n62Lk4hAS2Mcoce7fDHYIZz2jxJ77b6CcE0wSU+b3sYG0CAksYZTo7BIE\r
+ sVkEVCR2bl/FCmKzCWhIbNu/nBHEFhHQkbh9aAE7iM0sIC3x7XczE4gtLKArsbdxF1g9L1DN\r
+ 8ztvGSFmqks0PLrBAhEXlDg58wkLRK+WxI1/L5lArgaZs/wfB4jJCbTq7MQMkApRoAumnNzG\r
+ NoFRaBaS5llImmchNC9gZF7FKJuSW6Wbm5iZU5yarFucnJiXl1qka6KXm1mil5pSuokRHM6S\r
+ /DsYvx1UOsQowMGoxMN7gUshQIg1say4MvcQoyQHk5Ior2IoUIgvKT+lMiOxOCO+qDQntfgQ\r
+ owQHs5II7x1foBxvSmJlVWpRPkxKmoNFSZz3aspNfyGB9MSS1OzU1ILUIpisDAeHkgTvsTCg\r
+ RsGi1PTUirTMnBKENBMHJ8hwHqDhh0FqeIsLEnOLM9Mh8qcYFaXEeZ+BJARAEhmleXC9sHTz\r
+ ilEc6BVh3kMgVTzAVAXX/QpoMBPQYG95OZDBJYkIKakGRr81646E2O0zOXdD1jR7lUdZwjy+\r
+ 18x2T6dHr1NXrbQ5u0T8fqrFlk+Ls3daLlKpydBj+Dtr02Ulz8sNB42+f1c06dp9IrVno8nv\r
+ /ZocEVpTnv9eVHd7y5c4l33qOb71qiq3dol5FRS9r5jSPuvPgw3bjstcuSJ4v6mafZ5LyH5N\r
+ lQ2+D/2f1imxFGckGmoxFxUnAgD5yFh8EgMAAA==\r
+Cc: 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: Mon, 06 Aug 2012 23:47:37 -0000\r
+\r
+Nice catch. I think the solution is either exactly this, or we should\r
+strip "thread:" off notmuch-search-target-thread when we set it. I\r
+would lean slightly toward the latter so we don't have to generate up\r
+a new (identical) string on every notmuch-search-show-result call, but\r
+I doubt it would make much difference in the grand scheme of things.\r
+\r
+Quoth Mark Walters on Aug 07 at 12:10 am:\r
+> \r
+> Hi\r
+> \r
+> I have found a small bug in the recent changes to notmuch search to use\r
+> the JSON output. If you refresh the search buffer "point" does not stay\r
+> on the same thread. \r
+> \r
+> I think the problem is that notmuch-search-refresh-view calls notmuch\r
+> search with target-thread set to notmuch-search-find-thread-id which\r
+> returns the thread-id with "thread:" prefixed, whereas\r
+> notmuch-search-show-result checks for a match with (plist-get result\r
+> :thread) which is the thread id with no prefix.\r
+> \r
+> The patch below fixes this but I am not sure it is the nicest fix.\r
+> \r
+> Best wishes\r
+> \r
+> Mark\r
+> \r
+> diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+> index d2d82a9..a53d5a0 100644\r
+> --- a/emacs/notmuch.el\r
+> +++ b/emacs/notmuch.el\r
+> @@ -798,7 +798,7 @@ non-authors is found, assume that all of the authors match."\r
+> (insert "\n")\r
+> (notmuch-search-color-line beg (point) (plist-get result :tags))\r
+> (put-text-property beg (point) 'notmuch-search-result result))\r
+> - (when (string= (plist-get result :thread) notmuch-search-target-thread)\r
+> + (when (string= (concat "thread:" (plist-get result :thread)) notmuch-search-target-thread)\r
+> (setq notmuch-search-target-thread "found")\r
+> (goto-char beg)))))\r
+> \r
+> \r