[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: diff-goto-source hi-jacks my M-o
From: |
Dmitry Alexandrov |
Subject: |
Re: diff-goto-source hi-jacks my M-o |
Date: |
Tue, 07 Jul 2020 00:46:49 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Tomas Nordin <tomasn@posteo.net> wrote:
> Dmitry Alexandrov <dag@gnui.org> writes:
>> I am not sure, what ‘dummy’ is supposed to mean here? Minor mode is fully
>> functional, that is you are free to disable and reenable it at will:
>
> I think I sort of tried to be funny, based on that the mode was made up just
> to keep a key binding available in all situations.
No, itʼs not required there, you are free to enable ‘my-precious-keys-map’
unconditionally as well:
(add-to-list 'emulation-mode-map-alists
(list (cons t my-precious-keys-map)))
if you feel that you will never need to suspend it.
> And that the trickery with the key-maps is hard to follow for me.
There is no any trickery, just a hardcoded priority order in Emacs itself:
global map is overridden by major mode map, which in turn is overridden by
minor mode maps, which can be overridden by emulation mode maps.
That is, using a minor mode map would suffice in your specific case — about M-o
in diff-mode. But so would a mere:
(with-eval-after-load 'diff-mode
(define-key diff-mode-map
(kbd "M-o") nil)) ; also on RET, o, C-c C-c, which is more than
enough
> I got the impression that it sufficed to evaluate the forms, I mean, I didn't
> say, M-x my-precious-keys-mode .
>>>> (define-minor-mode my-precious-keys-mode "" t)
| (define-minor-mode MODE DOC &optional INIT-VALUE LIGHTER KEYMAP &rest BODY)
|
| ‹…›
|
| Optional INIT-VALUE is the initial value of the mode’s variable.
signature.asc
Description: PGP signature