[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to handle both minor mode and major mode remapping a command?
From: |
Ihor Radchenko |
Subject: |
Re: How to handle both minor mode and major mode remapping a command? |
Date: |
Thu, 19 Dec 2024 17:38:05 +0000 |
Michael Heerdegen <michael_heerdegen@web.de> writes:
> Ihor Radchenko <yantar92@posteo.net> writes:
>
>> I am wondering if there is some canonical way to handle similar scenarios
>> recommended for major modes.
>>
>> Any suggestions?
>
> Why not, as in similar situations, define a `kill-line-function'
> variable with default value `kill-line-default-function' which is a
> function (more or less our current `kill-line').
>
> Any mode that wants to modify the behavior would `add-function' on that
> variable binding. We would have one single place where the thing is
> controlled, while the behavior can still be modified by future modes.
That will, of course, work. However, I feel that it will only solve this
exact problem, but nothing more.
Just in Org mode, we also need special handling of
`move-beginning-of-line' and `move-end-of-line' for visual mode (for the
same reasons). Does it mean that we need to introduce yet more
"*-function" variables? It will not be scalable.
What I was thinking about is some way for command remapping to:
1. remap overriding minor modes
2. be able to access commands (possible remapped) that are shadowed by
current remapping
Maybe what I want is advice flexibility for keymaps. (not sure)
--
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>