--- /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 C29FD431FAF\r
+ for <notmuch@notmuchmail.org>; Sun, 6 Jan 2013 23:04:21 -0800 (PST)\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 imAXnic6kmpw for <notmuch@notmuchmail.org>;\r
+ Sun, 6 Jan 2013 23:04:19 -0800 (PST)\r
+Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU\r
+ [18.9.25.12])\r
+ by olra.theworths.org (Postfix) with ESMTP id AF7EE431FAE\r
+ for <notmuch@notmuchmail.org>; Sun, 6 Jan 2013 23:04:19 -0800 (PST)\r
+X-AuditID: 1209190c-b7fa86d000001d37-34-50ea737249a6\r
+Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
+ by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id E2.53.07479.2737AE05; Mon, 7 Jan 2013 02:04:18 -0500 (EST)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+ by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id r0774H4Z026496; \r
+ Mon, 7 Jan 2013 02:04:18 -0500\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 r0774FCc016660\r
+ (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
+ Mon, 7 Jan 2013 02:04:16 -0500 (EST)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1Ts6kp-0005KJ-2y; Mon, 07 Jan 2013 02:04:15 -0500\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] emacs: show: make id links respect window\r
+In-Reply-To: <1355958602-16752-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1355958602-16752-1-git-send-email-markwalters1009@gmail.com>\r
+User-Agent: Notmuch/0.14+236~gf64406d (http://notmuchmail.org) Emacs/23.4.1\r
+ (i486-pc-linux-gnu)\r
+Date: Mon, 07 Jan 2013 02:04:14 -0500\r
+Message-ID: <87vcb9jwy9.fsf@awakening.csail.mit.edu>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFnrDIsWRmVeSWpSXmKPExsUixCmqrFtU/CrAYNFmQYvVc3ksrt+cyezA\r
+ 5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZXxacZ2loEGw4vqDP+wNjPN5uxg5OSQETCRe\r
+ rvzPDGGLSVy4t56ti5GLQ0hgH6PEiWUHmCGc9YwSv85+Z4JwLjBJzH4+lx3CWcIo8fL1FbB+\r
+ NgENiW37lzOC2CICrhJPv30GiwsL2Enca53ABmJzCnhJdN1bydrFyAHU7Cnx6rsMSFhUIF7i\r
+ +b1vLCA2i4CqxOnuh2DlvEDnPWvYwAphC0qcnPkErIZZQEvixr+XTBMYBWYhSc1CklrAyLSK\r
+ UTYlt0o3NzEzpzg1Wbc4OTEvL7VI11AvN7NELzWldBMjOCAleXYwvjmodIhRgINRiYf3gsGr\r
+ ACHWxLLiytxDjJIcTEqivMcKgUJ8SfkplRmJxRnxRaU5qcWHGCU4mJVEeHnsgXK8KYmVValF\r
+ +TApaQ4WJXHeyyk3/YUE0hNLUrNTUwtSi2CyMhwcShK8e4uAGgWLUtNTK9Iyc0oQ0kwcnCDD\r
+ eYCGvwGp4S0uSMwtzkyHyJ9i1OVoeHnjKaMQS15+XqqUOO8ekCIBkKKM0jy4ObBE8opRHOgt\r
+ YV5TkCoeYBKCm/QKaAkT0JLUx89BlpQkIqSkGhiD7tYKzGr9/1Gf9+Tpf0FvyuaYT7sh+ddV\r
+ 52rmxYiFUnpSl17mv64ROxVvOaPAJNQhtm9DwJUexbgdi4pud3/RFuhhPRF4UC/4dq2AzMuv\r
+ 92d9UU2bVBKSdnNlxw5xo+3+1rapbW8Or2XteL/Cc8WDfP04vlDLJyIvGheuEfo71yv/70aX\r
+ 1BlKLMUZiYZazEXFiQAYp0Yu/wIAAA==\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, 07 Jan 2013 07:04:21 -0000\r
+\r
+On Wed, 19 Dec 2012, Mark Walters <markwalters1009@gmail.com> wrote:\r
+> There is a bug in current notmuch: if you have multiple windows in one\r
+> frame and click an id button link in a show buffer that does not\r
+> contain point then the link is opened in the window containing point.\r
+>\r
+> This reads the mouse event to make sure that the correct window is\r
+> used for the link.\r
+\r
+Personally I prefer that point move to the clicked window, as this patch\r
+does. The fact that it's even possible for point not to move to the\r
+clicked window I find strange.\r
+\r
+> ---\r
+>\r
+> I think this is a bug but that could be debated. It is particularly\r
+> easy to trigger with notmuch pick because that uses the split pane\r
+> while focus usually remains in the `pick' pane rather than the `show'\r
+> pane.\r
+>\r
+> The lisp is not pretty but seems to work.\r
+>\r
+> Best wishes\r
+>\r
+> Mark\r
+>\r
+>\r
+>\r
+>\r
+> emacs/notmuch-show.el | 5 +++++\r
+> 1 files changed, 5 insertions(+), 0 deletions(-)\r
+>\r
+> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+> index 5751d98..5664ea3 100644\r
+> --- a/emacs/notmuch-show.el\r
+> +++ b/emacs/notmuch-show.el\r
+> @@ -1077,6 +1077,11 @@ buttons for a corresponding notmuch search."\r
+> (make-text-button (first link) (second link)\r
+> 'action `(lambda (arg)\r
+> (notmuch-show ,(third link)))\r
+> + 'mouse-action `(lambda (arg)\r
+> + (let* ((event last-input-event)\r
+> + (window (car (cadr event))))\r
+\r
+Better would be (posn-window (event-start event)). If you use the\r
+accessors, I don't think the let bindings are really necessary since the\r
+code becomes self-documenting.\r
+\r
+> + (select-window window)\r
+> + (notmuch-show ,(third link))))\r
+\r
+Would it be better to (button-activate arg) so you don't have to\r
+duplicate the action code? (Then you also wouldn't need the\r
+quasiquoting and unquoting.)\r
+\r
+> 'follow-link t\r
+> 'help-echo "Mouse-1, RET: search for this message"\r
+> 'face goto-address-mail-face)))))\r
+> -- \r
+> 1.7.9.1\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r