[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: diff-goto-source hi-jacks my M-o
From: |
Tomas Nordin |
Subject: |
Re: diff-goto-source hi-jacks my M-o |
Date: |
Sun, 27 Dec 2020 16:09:22 +0100 |
Dmitry Alexandrov <dag@gnui.org> writes:
> 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.
Alright, then we know the way to go if we have a set of bindings that
must never be "hi-jacked"
>
>> 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
That's the way I go about it. It is rare enough this binding is used
anywhere (apart from the original binding about setting face of course)
Thanks
--
Tomas
- Re: diff-goto-source hi-jacks my M-o,
Tomas Nordin <=