Re: On keybindings and the slow erosion of help's utility

Eli Zaretskii <[email protected]> Sun, 02 Aug 2026 13:38:17 +0300
Newsgroups gmane.emacs.devel
Message-ID <[email protected]>
> From: Ihor Radchenko <[email protected]>
> Cc: [email protected], [email protected], [email protected]
> Date: Sun, 02 Aug 2026 10:24:49 +0000
> 
> Eli Zaretskii <[email protected]> writes:
> 
> >> The difference is that the "command" return value can resume the key
> >> lookup. If it returns nil, Emacs will continue key lookup in other
> >> keymaps. If it returns a keymap, Emacs will continue lookup in the
> >> returned keymap. Such things are currently not possible with command
> >> binding.
> >
> > Sorry, I'm not following.  A command can definitely perform look up in
> > any keymaps it wants, and do whatever it wants with what it finds
> > there, including calling the bindings it finds there.  What are the
> > advantages of doing that under Emacs's control instead of under the
> > control of a command?
> 
> Let's consider a simple case.
> We want to bind C-k in foo-mode-map but only on specific lines in file.
> When the point is elsewhere, we just want Emacs to call whatever is
> bound to C-k as if C-k in foo-mode-map were not bound at all.
> How would you do it with a command?

The command would test if point is on one of those specific lines, and
if not, call the binding of C-k in the "next" keymap in effect in the
buffer.