unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: Mark Walters <markwalters1009@gmail.com>,
	David Bremner <david@tethera.net>,
	notmuch@notmuchmail.org
Subject: Re: [PATCH] emacs: show: make id links respect window
Date: Sun, 06 Jan 2013 17:56:23 +0200	[thread overview]
Message-ID: <m2txqufgpk.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <87k3rqz594.fsf@qmul.ac.uk>

On Sun, Jan 06 2013, Mark Walters <markwalters1009@gmail.com> wrote:

> On Sat, 05 Jan 2013, Tomi Ollila <tomi.ollila@iki.fi> wrote:
>> On Wed, Dec 26 2012, David Bremner <david@tethera.net> wrote:
>>
>>> Mark Walters <markwalters1009@gmail.com> writes:
>>>
>>>>> I can imagine that people would want/like the "open in other window" 
>>>>> effect of the current code, even if the reason is a bug.
>>>>
>>>> That's definitely possible. I generally expect a mouse click to select
>>>> the window I click and this feels counter intuitive. I think that some
>>>> people might like an option "open this link in a new window" but I would
>>>> guess that would like that whether they clicked or pressed RET on the
>>>> button.
>>>
>>> I don't care much either way myself, but before we change notmuch-show
>>> behaviour (effectively) to accomodate notmuch-pick, I'd like a bit more
>>> feedback from other people.
>>
>> I tested the old behaviour -- split frame to 2 windows, one containing
>> *scratch* and one *notmuch-hello*. Then I searched for 'obsoletes',
>> chose last message (id:1356936162-2589-1-git-send-email-amdragon@mit.edu)
>> moved point to *scratch* buffer and clicked the id: link -- and indeed,
>> the *scratch* window was replaced.
>>
>> I didn't look or test Mark's patch as he stated:
>> "The lisp is not pretty but seems to work." ;)
>> ... well, not entirely because of that but I trust it opens the message
>> in window where the clicked link were and keeps point where it used to
>> be before clicking (in case point was in different window).
>
> It doesn't quite do this: point moves to the window that was clicked. It
> is just as easy to do as Tomi says (patch below but I should resend if
> people like it so the commit message gets picked up).

It seems to be the default (and iniuitively expected) behaviour that
point moves to the window that was clicked... so that's ok :)

> Incidentally, I would be interested to know what people expect the
> following to do: go to notmuch hello and then search. Now display the
> results in two windows simultaneously (either split the frame into two
> windows (c-x 2) or use 2 frames (C-x 5 2)) and then press q.
>
> What actually happens is that q runs kill buffer so it disappears in
> both windows: one of which will fall back to notmuch-hello and one of
> which will fall back to some other window (eg scratch)

I think that is just expected behaviour, there are e.g.. c-x b and c-x 0
which should be familiar to every emacs users...

> Best wishes
>
> Mark

Tomi

PS: did you change anything in the patch below ?

>
>  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..00b9b56 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))))
> +					     (with-selected-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
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

  reply	other threads:[~2013-01-06 15:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2013-01-06 16:10             ` Mark Walters
2013-01-07  7:04 ` Austin Clements

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2txqufgpk.fsf@guru.guru-group.fi \
    --to=tomi.ollila@iki.fi \
    --cc=david@tethera.net \
    --cc=markwalters1009@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).