[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tip: tty mode-line popup menus
From: |
Gerd Möllmann |
Subject: |
Re: Tip: tty mode-line popup menus |
Date: |
Tue, 10 Dec 2024 10:32:10 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
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.