|
From: | Ergus |
Subject: | Re: New Context Menu |
Date: | Wed, 18 Aug 2021 20:10:52 +0200 |
On Wed, Aug 18, 2021 at 07:50:42PM +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 >> Could we add an option to avoid this and have the same interaction >> behavior than in gui please?: mouse-3 activates the menu, a click over >> an option selects it and a click outside the menu hides the menu >> >> I know this may be something external to emacs itself; maybe it is how >> xterm menu behaves, but probably there is a way to go around this >> without excessive complexity. > >I'm quite sure it's how the mouse support behaves, and has nothing to >do with what Juri did. You should see the same behavior in any menu >on that display. > >It works for me as you expect on the w32 console. > :( I supposed that. It will be hard to have such a functionality in xterm then. And no other terminal works completely fine with emacs for me.Actually, I take that back. The reason for what you see is that the menu is popped by down-mouse-3, not by mouse-3. So if we can arrange for optionally doing this with mouse-3 (why isn't that the default, btw?), or if you could do that in your customizations, you should be able to have the behavior you want.
Indeed, I tried that and it works! Something as simple as: (global-unset-key [down-mouse-3]) (global-set-key [mouse-3] context-menu-entry) seems to work; but maybe Juri made the other one the default for some reason. Any way I agree that this behavior is more comfortable and probably should be the default. But at least this needs a custom or to be documented for new users. I would do something more or less like: (defcustom context-menu-mode-binding [down-mouse-3] "BLABLA") (...) (context-menu-mode (setq context-menu--old-mouse-3 (global-key-binding [mouse-3])) (setq context-menu--old-down-mouse-3 (global-key-binding [down-mouse-3])) (global-unset-key [mouse-3]) (global-unset-key [down-mouse-3]) (global-set-key context-menu-mode-binding context-menu-entry)) Apart from that, there is another issue with the "Paste" command in tty. Paste calls mouse-yank-primary, but in tty this commands calls gui-get-primary-selection and there is no selection because it tries to get the one on the primary selection not the one in the system (secoundary or clipboard) not the emacs kill-ring either. So I get: error("No selection is available")
[Prev in Thread] | Current Thread | [Next in Thread] |