unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Tip: tty mode-line popup menus
@ 2024-12-09  8:01 Gerd Möllmann
  2024-12-09 10:40 ` Jean Louis
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Gerd Möllmann @ 2024-12-09  8:01 UTC (permalink / raw)
  To: Emacs Devel

Just a tip I wanted to share. Maybe some tty Emacs user finds it useful.
Couldn't find anything mentioned on the internet.

When clicking on, say, the major mode indicator in the mode-line
different things happen, depending on whether I'm using a GUI or tty
Emacs (-nw):

- GUI (NS In may case): a popup menu opens on down-mpuse-1 and stays
  open when I release the mouse button.

- Tty: a popup menu opens on down-mouse-1 and is closed as soon as I
  release the mouse button. If the mouse is over a menu item[B releasing
  the button also selects the menu item.

I don't like the tty behavior. It is fiddly with a track pad, which I
normally use, leading to inadvertent menu selections. Furthermore,
keyboard operation of the menu seems impossible.

To fix this, I've added this in my init.el:

  (defun my-fix-mode-line-map (map)
    (let* ((down-mouse (kbd "<mode-line> <down-mouse-1>"))
	   (mouse (kbd "<mode-line> <mouse-1>"))
	   (def (lookup-key map down-mouse)))
      (when def
	(define-key map down-mouse nil)
	(define-key map mouse def))))

  (my-fix-mode-line-map mode-line-major-mode-keymap)
  (my-fix-mode-line-map mode-line-minor-mode-keymap)

Have fun!



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-12-10 13:15 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-09  8:01 Tip: tty mode-line popup menus Gerd Möllmann
2024-12-09 10:40 ` Jean Louis
2024-12-09 14:58   ` Eli Zaretskii
2024-12-09 14:45 ` Eli Zaretskii
2024-12-09 15:15   ` Gerd Möllmann
2024-12-09 16:24     ` Eli Zaretskii
2024-12-09 21:54 ` Petteri Hintsanen
2024-12-10  3:32   ` Gerd Möllmann
2024-12-09 22:59 ` Stefan Kangas
2024-12-10  6:14   ` Gerd Möllmann
2024-12-10  9:32     ` Gerd Möllmann
2024-12-10 10:09       ` Gerd Möllmann
2024-12-10 13:15         ` Gerd Möllmann

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