* Re: [Emacs-diffs] master 455a236: New function 'xref-find-definitions-at-mouse'
[not found] ` <20180707090052.4B7F9204E8@vcs0.savannah.gnu.org>
@ 2018-07-09 13:55 ` Stefan Monnier
2018-07-09 19:52 ` Tobias Gerdin
0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2018-07-09 13:55 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Tobias Gerdin, emacs-devel
> +(defun xref-find-definitions-at-mouse (event)
> + "Find the definition of identifier at or around mouse click.
> +This command is intended to be bound to a mouse event."
> + (interactive "e")
If we use
(defun xref-find-definitions-at-mouse (&optional event)
"Find the definition of identifier at or around mouse click.
This command is intended to be bound to a mouse event."
(interactive (list last-nonmenu-event))
then this command will also work with non-mouse events.
Stefan
PS: No, I don't know why we usually use last-nonmenu-event rather
than last-command-event or last-input-event for those commands.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Emacs-diffs] master 455a236: New function 'xref-find-definitions-at-mouse'
2018-07-09 13:55 ` [Emacs-diffs] master 455a236: New function 'xref-find-definitions-at-mouse' Stefan Monnier
@ 2018-07-09 19:52 ` Tobias Gerdin
2018-07-09 20:25 ` Stefan Monnier
0 siblings, 1 reply; 5+ messages in thread
From: Tobias Gerdin @ 2018-07-09 19:52 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
Den 2018-07-09 kl. 15:55, skrev Stefan Monnier:
>> +(defun xref-find-definitions-at-mouse (event)
>> + "Find the definition of identifier at or around mouse click.
>> +This command is intended to be bound to a mouse event."
>> + (interactive "e")
> If we use
>
> (defun xref-find-definitions-at-mouse (&optional event)
> "Find the definition of identifier at or around mouse click.
> This command is intended to be bound to a mouse event."
> (interactive (list last-nonmenu-event))
>
> then this command will also work with non-mouse events.
>
>
> Stefan
>
>
> PS: No, I don't know why we usually use last-nonmenu-event rather
> than last-command-event or last-input-event for those commands.
I'm afraid I do not see the point of making it work without mouse
events? Would that be in the interest of merging it with
'xref-find-definitions' somehow?
-Tobias
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Emacs-diffs] master 455a236: New function 'xref-find-definitions-at-mouse'
2018-07-09 19:52 ` Tobias Gerdin
@ 2018-07-09 20:25 ` Stefan Monnier
2018-07-09 20:53 ` Helmut Eller
0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2018-07-09 20:25 UTC (permalink / raw)
To: emacs-devel
> I'm afraid I do not see the point of making it work without mouse events?
I look at it from the other side: what's the point of making it work
only when bound to a mouse event?
> Would that be in the interest of merging it with
> 'xref-find-definitions' somehow?
I haven't made the effort to try and understand what's the real
difference between xref-find-definitions and
xref-find-definitions-at-mouse, so I can't really answer.
Maybe they can be merged, but maybe they are meant to behave differently
(e.g. xref-find-definitions-at-mouse should never prompt the user about
which identifier to use?).
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Emacs-diffs] master 455a236: New function 'xref-find-definitions-at-mouse'
2018-07-09 20:25 ` Stefan Monnier
@ 2018-07-09 20:53 ` Helmut Eller
0 siblings, 0 replies; 5+ messages in thread
From: Helmut Eller @ 2018-07-09 20:53 UTC (permalink / raw)
To: emacs-devel
On Mon, Jul 09 2018, Stefan Monnier wrote:
> Maybe they can be merged, but maybe they are meant to behave differently
> (e.g. xref-find-definitions-at-mouse should never prompt the user about
> which identifier to use?).
For "mouse mode" it might also be more natural to use an actual popup
menu instead of the *xref* buffer to display a list of choices.
Helmut
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Emacs-diffs] master 455a236: New function 'xref-find-definitions-at-mouse'
@ 2018-07-10 14:03 Tobias Gerdin
0 siblings, 0 replies; 5+ messages in thread
From: Tobias Gerdin @ 2018-07-10 14:03 UTC (permalink / raw)
To: eller.helmut; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 438 bytes --]
>
> On Mon, Jul 09 2018, Stefan Monnier wrote:
>
> > Maybe they can be merged, but maybe they are meant to behave differently
> > (e.g. xref-find-definitions-at-mouse should never prompt the user about
> > which identifier to use?).
>
> For "mouse mode" it might also be more natural to use an actual popup
> menu instead of the *xref* buffer to display a list of choices.
>
> Helmut
Good idea, I will try to look in to this!
-Tobias
[-- Attachment #2: Type: text/html, Size: 795 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-07-10 14:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20180707090050.359.98328@vcs0.savannah.gnu.org>
[not found] ` <20180707090052.4B7F9204E8@vcs0.savannah.gnu.org>
2018-07-09 13:55 ` [Emacs-diffs] master 455a236: New function 'xref-find-definitions-at-mouse' Stefan Monnier
2018-07-09 19:52 ` Tobias Gerdin
2018-07-09 20:25 ` Stefan Monnier
2018-07-09 20:53 ` Helmut Eller
2018-07-10 14:03 Tobias Gerdin
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.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).