--- /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 738DC431FAF\r
+ for <notmuch@notmuchmail.org>; Mon, 7 Jan 2013 12:22:27 -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 vmUDB5Uyh-qp for <notmuch@notmuchmail.org>;\r
+ Mon, 7 Jan 2013 12:22:26 -0800 (PST)\r
+Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU\r
+ [18.9.25.13])\r
+ by olra.theworths.org (Postfix) with ESMTP id AA597431FAE\r
+ for <notmuch@notmuchmail.org>; Mon, 7 Jan 2013 12:22:26 -0800 (PST)\r
+X-AuditID: 1209190d-b7efd6d000001a82-c1-50eb2e802e12\r
+Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
+ by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id E8.F8.06786.08E2BE05; Mon, 7 Jan 2013 15:22:24 -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 r07KMNN8021436; \r
+ Mon, 7 Jan 2013 15:22:24 -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 r07KMLKV020117\r
+ (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
+ Mon, 7 Jan 2013 15:22:23 -0500 (EST)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1TsJDB-0000hY-N1; Mon, 07 Jan 2013 15:22:21 -0500\r
+Date: Mon, 7 Jan 2013 15:22:21 -0500\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Mark Walters <markwalters1009@gmail.com>\r
+Subject: Re: [PATCH] emacs: show: make buttons select window\r
+Message-ID: <20130107202221.GL17581@mit.edu>\r
+References: <1357583091-28738-1-git-send-email-markwalters1009@gmail.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <1357583091-28738-1-git-send-email-markwalters1009@gmail.com>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFmpkleLIzCtJLcpLzFFi42IR4hRV1m3Qex1gsHeTtMXquTwW12/OZHZg\r
+ 8tg56y67x7NVt5gDmKK4bFJSczLLUov07RK4Mjb+mMhasEG9YvUphQbGh/JdjJwcEgImEo13\r
+ 3jBD2GISF+6tZ+ti5OIQEtjHKLHvwmQWCGc9o8TZE3PZQKqEBC4wSax4zQqRWMIoMf3zcrB2\r
+ FgEVib6zsxhBbDYBDYlt+5eD2SICOhK3Dy1gB7GZBaQlvv1uZgKxhQVsJL6v/wBm8wLVTLi1\r
+ iB1igafElMPPoOKCEidnPmGB6NWSuPHvJVCcA2zO8n8cIGFOAS+J9V/Pga0SBTphysltbBMY\r
+ hWYh6Z6FpHsWQvcCRuZVjLIpuVW6uYmZOcWpybrFyYl5ealFukZ6uZkleqkppZsYwSEtybuD\r
+ 8d1BpUOMAhyMSjy8L11fBQixJpYVV+YeYpTkYFIS5X0s9zpAiC8pP6UyI7E4I76oNCe1+BCj\r
+ BAezkgjvtwdA5bwpiZVVqUX5MClpDhYlcd4rKTf9hQTSE0tSs1NTC1KLYLIyHBxKErzlukBD\r
+ BYtS01Mr0jJzShDSTBycIMN5gIbng9TwFhck5hZnpkPkTzEqSonzxoEkBEASGaV5cL2wlPOK\r
+ URzoFWHeWpAqHmC6gut+BTSYCWhw6uPnIINLEhFSUg2MDk/r9EW9T07cGbj5jJLvQ/EgzaRH\r
+ L2csUpn3VuHLi8qPx46yTzmyeKX3EieDvS9dn8x6v8+bk6FY9UrA+lL+ubdPcCxk/Hrsjo7f\r
+ sdvLQ1ujMjecfq5h+urzL4ktgd8kcw/+Pb3Bt7RZ7GKugNOX82bqfVu+O+ustW7yeT5RxGel\r
+ Or/8cgnvz0osxRmJhlrMRcWJAEr93ggUAwAA\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, 07 Jan 2013 20:22:27 -0000\r
+\r
+Quoth Mark Walters on Jan 07 at 6:24 pm:\r
+> Emacs has two button type objects: widgets (as used for saved searches\r
+> in notmuch-hello) and buttons as used by parts/citations and id links\r
+> in notmuch-show. These two behave subtly differently when clicked with\r
+> the mouse: widgets select the window clicked before running the\r
+> action, buttons do not.\r
+> \r
+> This patch makes all of these behave the same: clicking always selects\r
+> the clicked window. It does this by defining a notmuch-button-type\r
+> supertype that the other notmuch buttons can inherit from. This\r
+> supertype binds the mouse-action to select the window and then\r
+> activate the button.\r
+> ---\r
+> \r
+> This is a new patch attempting to do the same as\r
+> id:1355958602-16752-1-git-send-email-markwalters1009@gmail.com\r
+> \r
+> This version changes all notmuch buttons to select the appropriate\r
+> window before applying the action. This brings the buttons in line\r
+> with widgets (as used in notmuch hello) and whatever is used for\r
+> http:// links.\r
+> \r
+> I think that buttons should at least run the action in the clicked\r
+> window: whether point should remain there is less clear. This version\r
+> does leave point there as this is what widgets and links do (but this\r
+> would be easy to change).\r
+> \r
+> I don't know whether we want to do this for 0.15: the change for id\r
+> links would be nice, the other cases are less important. If preferred\r
+> I can provide a patch fixing that single instance.\r
+> \r
+> Finally, if anyone who uses the crypto stuff could check that it works\r
+> for crypto buttons that would be nice as I do not have crypto setup.\r
+> \r
+> Best wishes\r
+> \r
+> Mark\r
+> \r
+> \r
+> \r
+> \r
+> emacs/notmuch-crypto.el | 3 ++-\r
+> emacs/notmuch-lib.el | 5 +++++\r
+> emacs/notmuch-show.el | 4 +++-\r
+> emacs/notmuch-wash.el | 3 ++-\r
+> 4 files changed, 12 insertions(+), 3 deletions(-)\r
+> \r
+> diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el\r
+> index 83e5d37..173a3e7 100644\r
+> --- a/emacs/notmuch-crypto.el\r
+> +++ b/emacs/notmuch-crypto.el\r
+> @@ -76,7 +76,8 @@ mode."\r
+> (define-button-type 'notmuch-crypto-status-button-type\r
+> 'action (lambda (button) (message (button-get button 'help-echo)))\r
+> 'follow-link t\r
+> - 'help-echo "Set notmuch-crypto-process-mime to process cryptographic mime parts.")\r
+> + 'help-echo "Set notmuch-crypto-process-mime to process cryptographic mime parts."\r
+> + :supertype 'notmuch-button-type)\r
+\r
+This should be 'supertype for consistency.\r
+\r
+Also, notmuch-crypto.el should have a (require 'notmuch-lib) at the\r
+top now.\r
+\r
+> \r
+> (defun notmuch-crypto-insert-sigstatus-button (sigstatus from)\r
+> (let* ((status (plist-get sigstatus :status))\r
+> diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
+> index 0407f8a..1573e32 100644\r
+> --- a/emacs/notmuch-lib.el\r
+> +++ b/emacs/notmuch-lib.el\r
+> @@ -97,6 +97,11 @@ For example, if you wanted to remove an \"inbox\" tag and add an\r
+> :group 'notmuch-search\r
+> :group 'notmuch-show)\r
+> \r
+> +(define-button-type 'notmuch-button-type\r
+> + 'mouse-action (lambda (button)\r
+> + (select-window (posn-window (event-start last-input-event)))\r
+> + (button-activate button)))\r
+> +\r
+\r
+I think this deserves a comment explaining how buttons behave by\r
+default and the problems this causes both for code (funny results of\r
+buffer changes and point placement) and user experience (not moving\r
+point to the clicked window).\r
+\r
+> (defun notmuch-version ()\r
+> "Return a string with the notmuch version number."\r
+> (let ((long-string\r
+> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+> index 5751d98..059194d 100644\r
+> --- a/emacs/notmuch-show.el\r
+> +++ b/emacs/notmuch-show.el\r
+> @@ -469,7 +469,8 @@ message at DEPTH in the current thread."\r
+> 'action 'notmuch-show-part-button-default\r
+> 'keymap 'notmuch-show-part-button-map\r
+> 'follow-link t\r
+> - 'face 'message-mml)\r
+> + 'face 'message-mml\r
+> + :supertype 'notmuch-button-type)\r
+\r
+'supertype\r
+\r
+> \r
+> (defvar notmuch-show-part-button-map\r
+> (let ((map (make-sparse-keymap)))\r
+> @@ -1075,6 +1076,7 @@ buttons for a corresponding notmuch search."\r
+> ;; Remove the overlay created by goto-address-mode\r
+> (remove-overlays (first link) (second link) 'goto-address t)\r
+> (make-text-button (first link) (second link)\r
+> + :type 'notmuch-button-type\r
+\r
+'type\r
+\r
+> 'action `(lambda (arg)\r
+> (notmuch-show ,(third link)))\r
+> 'follow-link t\r
+> diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el\r
+> index d6db4fa..826b6f4 100644\r
+> --- a/emacs/notmuch-wash.el\r
+> +++ b/emacs/notmuch-wash.el\r
+> @@ -115,7 +115,8 @@ lower).")\r
+> (define-button-type 'notmuch-wash-button-invisibility-toggle-type\r
+> 'action 'notmuch-wash-toggle-invisible-action\r
+> 'follow-link t\r
+> - 'face 'font-lock-comment-face)\r
+> + 'face 'font-lock-comment-face\r
+> + :supertype 'notmuch-button-type)\r
+\r
+'supertype\r
+\r
+> \r
+> (define-button-type 'notmuch-wash-button-citation-toggle-type\r
+> 'help-echo "mouse-1, RET: Show citation"\r