emacs-devel
[Top][All Lists]
Advanced

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

Re: New Context Menu


From: Ergus
Subject: Re: New Context Menu
Date: Wed, 18 Aug 2021 19:17:53 +0200

On Wed, Aug 18, 2021 at 04:30:37PM +0300, Eli Zaretskii wrote:
Date: Wed, 18 Aug 2021 14:43:09 +0200
From: Ergus <spacibba@aol.com>
Cc: juri@linkov.net, emacs-devel@gnu.org

>> Maybe this is ask for too much, but I am wondering that once the context
>> menu will be released with emacs 28, then a lot of packages will try to
>> implement such a functionality in a hacky way with advises/hooks and so
>> on and they won't get properly maintained.
>
>I don't see how this can be worked around in a hook, because TTY menus
>are implemented entirely in C.
>
Users and external developers may try their best it this annoys them
enough.

Yes, but there are limits to that.  Like the speed of light, for
example.

>> In case the user wants to bind the context menu without using the mouse
>> how can be done? Will the context-menu appear in the current cursor
>> (point) or in the current mouse arrow position?
>
>We could do something similar to what we do when the user presses F10
>on a TTY frame.
>
On tty the F10 menu opens in the minibuffer.

??? It does not!  I just tried.  Are you trying in "emacs -Q"?

It would be better if we can just show the same menu than with the
mouse instead

That's what F10 is supposed to do.

Ahh sorry, I tried that from a real TTY ;). Now I get your point. Yes,
that's what I want.

because it appears in place, closer to where the user is editing.

If you want the menu to be dropped close to point, you need to tell
the menu code where that is, it by default expects to get that from
the event which triggered it, and that only works with mouse clicks,
not with keyboard keys.  In the implementation of F10, we use some
trick to do something similar, but since that opens the menu-bar menu,
the location of point is not very relevant, so we use something else.


Passing the point location shouldn't be too hard; maybe it only requires
an extra condition when the "event" is not a "mouse event" use the point
location. On tty some time ago that was an issue because the menu used
to open always in the middle... but now it is fixed.

>> I know the context menu without mouse is a bit pointless
>
>Why pointless? menus work on TTY frames without a mouse just fine, you
>can move and select using the keyboard.
>
But context menu it more mouse-oriented in general because it is a need
specially for more mouse oriented users. Why to do something like F10 +
arrow + arrow + Enter: when you can do just M-w?

Because menus are self-explanatory, whereas M-w requires that you
remember it?

Or why to use arrows if just used the mouse to activate the menu?

Because you don't have a mouse to begin with? or because you don't
want to move your fingers from the keyboard?  The usual reasons, IOW.



reply via email to

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