[Top][All Lists]

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

Re: Context menus and mouse-3

From: Eli Zaretskii
Subject: Re: Context menus and mouse-3
Date: Thu, 15 Jul 2021 09:22:16 +0300

> From: Juri Linkov <juri@linkov.net>
> Cc: monnier@iro.umontreal.ca,  philipk@posteo.net,  rms@gnu.org,
>   spacibba@aol.com,  emacs-devel@gnu.org,  arthur.miller@live.com,
>   dgutov@yandex.ru,  ghe@sdf.org,  drew.adams@oracle.com
> Date: Thu, 15 Jul 2021 02:37:11 +0300
> >> 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.

So you want to have the same menus on mouse-3, including when the menu
bar is not disabled?

> And some modes like org-mode, flyspell-mode, etc. already redefine
> down-mouse-3 to pop up context menus.

But those modes define those context menus on special parts of
display, where pasting etc. makes less sense, no?

> > I thought we were talking about existing menus popped by mouse-2 that
> I suppose you meant C-down-mouse-3?

Both, I guess.

> > 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.

I'm okay with adding a minor mode for this.  Based on its popularity,
we could later discuss whether it should be turned on by default.

> 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".

If this kind of "dwim-ish" heuristic solves the issue, we should use
it.  In situations where such heuristic doesn't give good results,
perhaps this new minor mode we are talking about can also decide which
alternative to prefer when it isn't clear-cut.

reply via email to

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