bug#81462: [PATCH] Skip non-key events in `where-is-internal' with FIRSTONLY
Aaron Zeng via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <[email protected]>
| Newsgroups | gmane.emacs.bugs |
|---|---|
| Message-ID | <CAB7SQMHyj4APaQYzqqTH55sDPwy3sV2HsfqZm7Fycs3Bc0YvEA@mail.gmail.com> |
On Sat, Aug 8, 2026 at 4:57 AM Eli Zaretskii <[email protected]> wrote: > > Ping! How can we make some further progress with this issue? > > > Cc: [email protected], [email protected] > > Date: Mon, 27 Jul 2026 23:07:25 -0400 > > From: Stefan Monnier via "Bug reports for GNU Emacs, > > the Swiss army knife of text editors" <[email protected]> > > > > > > I'd argue they *can* be invoked by users, by causing the > > corresponding event. I think it's not that different from the "events" > > used for menu entries. Or the pseudo-events used for clicks on GUI > > elements like `mode-line`, `left-fringe`, ... > > > > I think it's better to "demote" them (i.e. list them further down the > > list) rather than completely skip them. > > Returning to my original motivation for wanting to tweak the output of where-is-internal in the first place, I'd like to mention that another cause of suboptimal substitute-command-keys for my users is that many of them are Spacemacs users, and that distribution happens to use the bind-map package to set up some "leader key" style key bindings (and also enables evil-mode). In particular, there's a very large and nested keymap which is bound globally under SPC in emulation-mode-map-alists. I think for implementation reasons this needs to be a pretty high priority keymap---it needs to come before even evil-mode's emulation-mode-map-alists entries. However, the bindings available under this global SPC leader key are all pretty long, and when a shorter key binding for the same command is available in, e.g., the major mode map, I would prefer to show the latter in substitute-command-keys output. So, if there was a way to control the priority order of keymaps for substitute-command-keys/where-is-internal's output (while still respecting the shadowing caused by the *actual* priority order), that would make this easier. In my use case, it seems more natural to determine the priority by demoting entire keymaps/entries in the current-active-maps list rather than specific input events.