all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: Nathan Collins <nathan.collins@gmail.com>,
	emacs-orgmode@gnu.org, emacs-devel@gnu.org
Subject: Re: How to handle both minor mode and major mode remapping a command?
Date: Thu, 19 Dec 2024 17:38:05 +0000	[thread overview]
Message-ID: <87ikrf7ev6.fsf@localhost> (raw)
In-Reply-To: <8734imtdtf.fsf@web.de>

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>



  reply	other threads:[~2024-12-19 17:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-18 11:53 Bug: org-kill-line shouldn't assume visual-line-mode means kill-visual-line Nathan Collins
2024-12-15 10:48 ` How to handle both minor mode and major mode remapping a command? (was: Bug: org-kill-line shouldn't assume visual-line-mode means kill-visual-line) Ihor Radchenko
2024-12-17 17:33   ` How to handle both minor mode and major mode remapping a command? Michael Heerdegen
2024-12-19 17:38     ` Ihor Radchenko [this message]
2024-12-19 19:36       ` Michael Heerdegen
2024-12-21 12:00         ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ikrf7ev6.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-devel@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=michael_heerdegen@web.de \
    --cc=nathan.collins@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.