all messages for Emacs-related lists mirrored at yhetil.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

* Re: Tip: tty mode-line popup menus
  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
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 13+ messages in thread
From: Jean Louis @ 2024-12-09 10:40 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: Emacs Devel

* Gerd Möllmann <gerd.moellmann@gmail.com> [2024-12-09 11:04]:
> 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.

On my side, when I click on menu, it stays open.

-- 
Jean Louis



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

* Re: Tip: tty mode-line popup menus
  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:45 ` Eli Zaretskii
  2024-12-09 15:15   ` Gerd Möllmann
  2024-12-09 21:54 ` Petteri Hintsanen
  2024-12-09 22:59 ` Stefan Kangas
  3 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2024-12-09 14:45 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: emacs-devel

> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> Date: Mon, 09 Dec 2024 09:01:46 +0100
> 
> 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.

Yes.  TTY menus behave like the no-toolkit build of Emacs behaves,
because they share some of the code and the general design.

> I don't like the tty behavior.

You don't like it because you are used to how the various GUI toolkits
behave: they leave the menu displayed when you release the mouse
button.  But Emacs has always produced both kinds of behaviors,
depending on the toolkit (or lack thereof).  The reason for popping
down a menu on mouse release is that otherwise one needs a separate
event loop (which toolkits have and TTY mouse doesn't).

> It is fiddly with a track pad, which I normally use, leading to
> inadvertent menu selections. Furthermore, keyboard operation of the
> menu seems impossible.

??? Of course, it possible: type F10, and then use arrow keys to
navigate and RET to select.



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

* Re: Tip: tty mode-line popup menus
  2024-12-09 10:40 ` Jean Louis
@ 2024-12-09 14:58   ` Eli Zaretskii
  0 siblings, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2024-12-09 14:58 UTC (permalink / raw)
  To: Jean Louis; +Cc: gerd.moellmann, emacs-devel

> Date: Mon, 9 Dec 2024 13:40:05 +0300
> From: Jean Louis <bugs@gnu.support>
> Cc: Emacs Devel <emacs-devel@gnu.org>
> 
> * Gerd Möllmann <gerd.moellmann@gmail.com> [2024-12-09 11:04]:
> > 
> > - 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.
> 
> On my side, when I click on menu, it stays open.

When you click on the mode-line of a TTY frame? really?



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

* Re: Tip: tty mode-line popup menus
  2024-12-09 14:45 ` Eli Zaretskii
@ 2024-12-09 15:15   ` Gerd Möllmann
  2024-12-09 16:24     ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Gerd Möllmann @ 2024-12-09 15:15 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Gerd Möllmann <gerd.moellmann@gmail.com>
>> Date: Mon, 09 Dec 2024 09:01:46 +0100
>> 
>> 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.
>
> Yes.  TTY menus behave like the no-toolkit build of Emacs behaves,
> because they share some of the code and the general design.
>
>> I don't like the tty behavior.
>
> You don't like it because you are used to how the various GUI toolkits
> behave: they leave the menu displayed when you release the mouse
> button.  But Emacs has always produced both kinds of behaviors,
> depending on the toolkit (or lack thereof).  The reason for popping
> down a menu on mouse release is that otherwise one needs a separate
> event loop (which toolkits have and TTY mouse doesn't).

Yes, I remember the times. I didn't like it then either, with a mouse
:-).

>
>> It is fiddly with a track pad, which I normally use, leading to
>> inadvertent menu selections. Furthermore, keyboard operation of the
>> menu seems impossible.
>
> ??? Of course, it possible: type F10, and then use arrow keys to
> navigate and RET to select.

Doesn't work for me.

Without doing the changes I posted, I down-mouse-1 on something in the
mode-line having a menu. When I release the mouse, the menu is gone, as
I described. When I press F10, keeping the mouse button pressed, the
menu also disappears.

With the changes applied, mouse-1 opens the menu, and I then can use
cursor keys, RET, and so on. No F10 needed. 



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

* Re: Tip: tty mode-line popup menus
  2024-12-09 15:15   ` Gerd Möllmann
@ 2024-12-09 16:24     ` Eli Zaretskii
  0 siblings, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2024-12-09 16:24 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: emacs-devel

> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> Cc: emacs-devel@gnu.org
> Date: Mon, 09 Dec 2024 16:15:54 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> It is fiddly with a track pad, which I normally use, leading to
> >> inadvertent menu selections. Furthermore, keyboard operation of the
> >> menu seems impossible.
> >
> > ??? Of course, it possible: type F10, and then use arrow keys to
> > navigate and RET to select.
> 
> Doesn't work for me.
> 
> Without doing the changes I posted, I down-mouse-1 on something in the
> mode-line having a menu. When I release the mouse, the menu is gone, as
> I described. When I press F10, keeping the mouse button pressed, the
> menu also disappears.
> 
> With the changes applied, mouse-1 opens the menu, and I then can use
> cursor keys, RET, and so on. No F10 needed. 

Sorry, it's my misunderstanding: I didn't realize you were talking
about a menu opened from the mode line.

All the other menus, including the one popped up by C-mouse-1, do
support keyboard navigation.




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

* Re: Tip: tty mode-line popup menus
  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:45 ` Eli Zaretskii
@ 2024-12-09 21:54 ` Petteri Hintsanen
  2024-12-10  3:32   ` Gerd Möllmann
  2024-12-09 22:59 ` Stefan Kangas
  3 siblings, 1 reply; 13+ messages in thread
From: Petteri Hintsanen @ 2024-12-09 21:54 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: Emacs Devel

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> I don't like the tty behavior. It is fiddly with a track pad, which I
> normally use, leading to inadvertent menu selections.

There is a similar kind of behavior with normal (pull-down) tty menus as
well.  If you do:

 $ emacs -nw Q
 M-x xterm-mouse-mode RET
 {click on Tools menu}
 {click again on Tools menu (do not move the mouse between clicks)}

then you will get grep command, and I'd say inadvertently.  (Obviously
this was on xterm, but I suspect the same happens on other ttys.)

But if you move the mouse between clicks, even slightly, then the menu
selection is cleared, and you won't get grep command.  The menu is
simply closed, as I'd expect.

This has been itching me for quite some time, but not sufficiently
enough to make me write a patch.  I'm not sure if this is a bug or
feature, anyway.

Otherwise I think tty menus are great.

Thanks,
Petteri



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

* Re: Tip: tty mode-line popup menus
  2024-12-09  8:01 Tip: tty mode-line popup menus Gerd Möllmann
                   ` (2 preceding siblings ...)
  2024-12-09 21:54 ` Petteri Hintsanen
@ 2024-12-09 22:59 ` Stefan Kangas
  2024-12-10  6:14   ` Gerd Möllmann
  3 siblings, 1 reply; 13+ messages in thread
From: Stefan Kangas @ 2024-12-09 22:59 UTC (permalink / raw)
  To: Gerd Möllmann, Emacs Devel

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

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

How about adding a defcustom for this behavior?

I guess many users are on laptops with trackpads these days, and would
find that convenient.



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

* Re: Tip: tty mode-line popup menus
  2024-12-09 21:54 ` Petteri Hintsanen
@ 2024-12-10  3:32   ` Gerd Möllmann
  0 siblings, 0 replies; 13+ messages in thread
From: Gerd Möllmann @ 2024-12-10  3:32 UTC (permalink / raw)
  To: Petteri Hintsanen; +Cc: Emacs Devel

Petteri Hintsanen <petterih@iki.fi> writes:

> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>
>> I don't like the tty behavior. It is fiddly with a track pad, which I
>> normally use, leading to inadvertent menu selections.
>
> There is a similar kind of behavior with normal (pull-down) tty menus as
> well.  If you do:
>
>  $ emacs -nw Q
>  M-x xterm-mouse-mode RET
>  {click on Tools menu}
>  {click again on Tools menu (do not move the mouse between clicks)}
>
> then you will get grep command, and I'd say inadvertently.  (Obviously
> this was on xterm, but I suspect the same happens on other ttys.)
>

Yes, I can reproduce that here on macOS.

> But if you move the mouse between clicks, even slightly, then the menu
> selection is cleared, and you won't get grep command.  The menu is
> simply closed, as I'd expect.
>
> This has been itching me for quite some time, but not sufficiently
> enough to make me write a patch.  I'm not sure if this is a bug or
> feature, anyway.

Hard to believe that it's a feature. How about submitting a bug report
with M-x report-emacs-bug? (And then writing a patch :-)).




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

* Re: Tip: tty mode-line popup menus
  2024-12-09 22:59 ` Stefan Kangas
@ 2024-12-10  6:14   ` Gerd Möllmann
  2024-12-10  9:32     ` Gerd Möllmann
  0 siblings, 1 reply; 13+ messages in thread
From: Gerd Möllmann @ 2024-12-10  6:14 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Emacs Devel

Stefan Kangas <stefankangas@gmail.com> writes:

> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>
>> 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)
>
> How about adding a defcustom for this behavior?

Maybe, don't know. One problem is that I don't know where else something
similar is done. I know only the two places above plus one in the
Minions package, which probably simply mimicked what Emacs does in
bindings.el. Or in other words, I don't have enough of an overview to
design something that's really useful.

> I guess many users are on laptops with trackpads these days, and would
> find that convenient.

I guess so, especially if they use tap-to-click like I do.



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

* Re: Tip: tty mode-line popup menus
  2024-12-10  6:14   ` Gerd Möllmann
@ 2024-12-10  9:32     ` Gerd Möllmann
  2024-12-10 10:09       ` Gerd Möllmann
  0 siblings, 1 reply; 13+ messages in thread
From: Gerd Möllmann @ 2024-12-10  9:32 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Emacs Devel

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> Stefan Kangas <stefankangas@gmail.com> writes:
>
>> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>>
>>> 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)
>>
>> How about adding a defcustom for this behavior?
>
> Maybe, don't know. One problem is that I don't know where else something
> similar is done. I know only the two places above plus one in the
> Minions package, which probably simply mimicked what Emacs does in
> bindings.el. Or in other words, I don't have enough of an overview to
> design something that's really useful.
>
>> I guess many users are on laptops with trackpads these days, and would
>> find that convenient.
>
> I guess so, especially if they use tap-to-click like I do.

BTW, 

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

in combination with using the persistent-scratch package somehow seems
to mess up the major-mode mode-line menu. I don't yet understand how, so
be warned.



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

* Re: Tip: tty mode-line popup menus
  2024-12-10  9:32     ` Gerd Möllmann
@ 2024-12-10 10:09       ` Gerd Möllmann
  2024-12-10 13:15         ` Gerd Möllmann
  0 siblings, 1 reply; 13+ messages in thread
From: Gerd Möllmann @ 2024-12-10 10:09 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Emacs Devel

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>
>> Stefan Kangas <stefankangas@gmail.com> writes:
>>
>>> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>>>
>>>> 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)
>>>
>>> How about adding a defcustom for this behavior?
>>
>> Maybe, don't know. One problem is that I don't know where else something
>> similar is done. I know only the two places above plus one in the
>> Minions package, which probably simply mimicked what Emacs does in
>> bindings.el. Or in other words, I don't have enough of an overview to
>> design something that's really useful.
>>
>>> I guess many users are on laptops with trackpads these days, and would
>>> find that convenient.
>>
>> I guess so, especially if they use tap-to-click like I do.
>
> BTW, 
>
>    (my-fix-mode-line-map mode-line-major-mode-keymap)
>
> in combination with using the persistent-scratch package somehow seems
> to mess up the major-mode mode-line menu. I don't yet understand how, so
> be warned.

Resorting to logic sometimes helps. The problem is pretty simple:

Original definition in mode-line-major-mode-keymap looks like

	    (down-mouse-1 menu-item "Menu Bar" ignore :filter
			  #f(compiled-function (_) #<bytecode

Lookup-key does not return that

(lookup-key mode-line-major-mode-keymap (kbd "<mode-line> <down-mouse-1>"))
=> (keymap "IELM Mode" keymap
	(keymap
	 (ielm menu-item "IELM"
	       (keymap "IELM"
               ...

And setting that with define-key is not the right thing, obviously. One
would need a function returning the "raw" entry of a key in a keymap,
No idea if Emacs has such a function. If it does, I can't find it.

In essence, I have to retract that tip. It doesn't work as expected.



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

* Re: Tip: tty mode-line popup menus
  2024-12-10 10:09       ` Gerd Möllmann
@ 2024-12-10 13:15         ` Gerd Möllmann
  0 siblings, 0 replies; 13+ messages in thread
From: Gerd Möllmann @ 2024-12-10 13:15 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Emacs Devel

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>
>> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>>
>>> Stefan Kangas <stefankangas@gmail.com> writes:
>>>
>>>> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>>>>
>>>>> 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)
>>>>
>>>> How about adding a defcustom for this behavior?
>>>
>>> Maybe, don't know. One problem is that I don't know where else something
>>> similar is done. I know only the two places above plus one in the
>>> Minions package, which probably simply mimicked what Emacs does in
>>> bindings.el. Or in other words, I don't have enough of an overview to
>>> design something that's really useful.
>>>
>>>> I guess many users are on laptops with trackpads these days, and would
>>>> find that convenient.
>>>
>>> I guess so, especially if they use tap-to-click like I do.
>>
>> BTW, 
>>
>>    (my-fix-mode-line-map mode-line-major-mode-keymap)
>>
>> in combination with using the persistent-scratch package somehow seems
>> to mess up the major-mode mode-line menu. I don't yet understand how, so
>> be warned.
>
> Resorting to logic sometimes helps. The problem is pretty simple:
>
> Original definition in mode-line-major-mode-keymap looks like
>
> 	    (down-mouse-1 menu-item "Menu Bar" ignore :filter
> 			  #f(compiled-function (_) #<bytecode
>
> Lookup-key does not return that
>
> (lookup-key mode-line-major-mode-keymap (kbd "<mode-line> <down-mouse-1>"))
> => (keymap "IELM Mode" keymap
> 	(keymap
> 	 (ielm menu-item "IELM"
> 	       (keymap "IELM"
>                ...
>
> And setting that with define-key is not the right thing, obviously. One
> would need a function returning the "raw" entry of a key in a keymap,
> No idea if Emacs has such a function. If it does, I can't find it.
>
> In essence, I have to retract that tip. It doesn't work as expected.

And finally, the following works for me, FWIW.

  (defun my-lookup-down-mouse (map)
    (cl-flet ((lookup (event map)
		(catch 'found
                  (map-keymap (lambda (e d)
				(when (eq event e)
                                  (throw 'found d)))
                              map))))
      (let* ((mode-line (lookup 'mode-line map)))
	(when mode-line
          (lookup 'down-mouse-1 mode-line)))))

  (defun my-fix-mode-line-map (map)
    (let* ((down-mouse (kbd "<mode-line> <down-mouse-1>"))
	   (mouse (kbd "<mode-line> <mouse-1>"))
	   (def (my-lookup-down-mouse map)))
      (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)



^ 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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.