unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: show: make id links respect window
@ 2012-12-19 23:10 Mark Walters
  2012-12-24 15:54 ` David Bremner
  2013-01-07  7:04 ` Austin Clements
  0 siblings, 2 replies; 9+ messages in thread
From: Mark Walters @ 2012-12-19 23:10 UTC (permalink / raw)
  To: notmuch

There is a bug in current notmuch: if you have multiple windows in one
frame and click an id button link in a show buffer that does not
contain point then the link is opened in the window containing point.

This reads the mouse event to make sure that the correct window is
used for the link.
---

I think this is a bug but that could be debated. It is particularly
easy to trigger with notmuch pick because that uses the split pane
while focus usually remains in the `pick' pane rather than the `show'
pane.

The lisp is not pretty but seems to work.

Best wishes

Mark




 emacs/notmuch-show.el |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 5751d98..5664ea3 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1077,6 +1077,11 @@ buttons for a corresponding notmuch search."
 	(make-text-button (first link) (second link)
 			  'action `(lambda (arg)
 				     (notmuch-show ,(third link)))
+			  'mouse-action `(lambda (arg)
+					   (let* ((event last-input-event)
+						  (window (car (cadr event))))
+					     (select-window window)
+					     (notmuch-show ,(third link))))
 			  'follow-link t
 			  'help-echo "Mouse-1, RET: search for this message"
 			  'face goto-address-mail-face)))))
-- 
1.7.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-01-07  7:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-19 23:10 [PATCH] emacs: show: make id links respect window Mark Walters
2012-12-24 15:54 ` David Bremner
2012-12-25 11:04   ` Mark Walters
2012-12-26 15:01     ` David Bremner
2013-01-05 21:50       ` Tomi Ollila
2013-01-06 15:43         ` Mark Walters
2013-01-06 15:56           ` Tomi Ollila
2013-01-06 16:10             ` Mark Walters
2013-01-07  7:04 ` Austin Clements

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).