[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Context menus and mouse-3

From: Juri Linkov
Subject: Re: Context menus and mouse-3
Date: Thu, 15 Jul 2021 02:37:11 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

>> Context menus are useful everywhere, not just in special places.
>> For example, selecting "Paste" from the context menu makes sense
>> everywhere.
> Where in Emacs do we have context menus which include "Paste"?

When the menu-bar is disabled, then C-down-mouse-3 pops up the global
menu where "Edit" contains "Paste".  When the menu-bar is enabled,
then some modes include "Paste" (e.g. calculator-paste) in a buffer-local menu.
And some modes like org-mode, flyspell-mode, etc. already redefine
down-mouse-3 to pop up context menus.

> I thought we were talking about existing menus popped by mouse-2 that

I suppose you meant C-down-mouse-3?

> you'd like to pop up with mouse-3.  If this isn't the case, then what
> menus are we talking about here?  In particular, if you want to _add_
> menus which currently don't exist in contexts where we currently don't
> offer menus, that could be an entirely new minor mode, and then the
> conflict with current bindings of mouse-3 could be resolved as part of
> that mode.

It seems a new minor mode is unavoidable because when the user wants
down-mouse-3 to pop up the context menu immediately, then
for the best effect down-mouse-3 should be bound directly
to the context-map, instead of sending the [context-menu] event.

>> In the previous patch, the defcustom is named mouse-3-down-context-menu.
>> When it's customized to nil, then only the current behavior is available
>> with mouse-save-then-kill.  When customized to t, then the context menu
>> pops up immediately.
> I was thinking about something more flexible than an all-or-nothing
> setting.  A delay is not really intelligent enough, since it again is
> a global value.  I was thinking about something sensitive to the
> context.

The users who currently use mouse-3 to operate on the region
might want to continue using it even on context-sensitive regions.

For example, like in all browsers, down-mouse-3 in e.g. Info browser or eww,
will show the menu with such items as "Backward" and "Forward".
But when down-mouse-3 will be clicked on a link, it will display
the context sensitive menu with "Follow" and "Open in New Window".

reply via email to

[Prev in Thread] Current Thread [Next in Thread]