emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Current mode command discovery


From: Stefan Kangas
Subject: Re: Current mode command discovery
Date: Sat, 20 Feb 2021 09:37:57 -0600

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
>> Now that we have mode markup, should there be a command like `M-x', but
>> instead lists only those commands that are specifically relevant to the
>> current buffer?
>>
>> This would only be commands that have been marked for the current major
>> mode and any active minor modes, I guess?
>>
>> If so, should that be bound to something, and if so, what?
>
> I've now added a first attempt at this to the trunk now.

Looks like a good first attempt!

With the short list presented by `M-S-x', it does seem more important
that the commands that show up are highly relevant.  In `list-bookmark',
I see some stuff in the completion list that I wonder about:

- `digit-argument'.  Should it be in `M-x', or is it more like
  `mwheel-scroll'?  Should it be in `M-S-x'?

- `negative-argument', I can see why one would keep it in `M-x', I
  guess, but in `M-S-x'?

- Finally, `forward-button' and `backward-button'.  But I can't find who
  binds it?  In any case, it doesn't seem relevant to this mode.
  I guess it should be the responsibility of the mode to unbind any such
  commands.

> Peculiarities that we might consider:
>
> `ignore' shows up here, because we've bound `h' to `ignore' as a way to
> disable that key binding.  That doesn't sound kinda non-ideal -- it
> should be unbound instead.

True.  But it would be good to find a general solution (third-party
developers will use it even if we fix eww).

One idea is to a special list of commands that `M-S-x' specifically
always ignores (and add `ignore' to it).

> The command name is really bad, though:
> `execute-extended-command-for-buffer'.  Suggestions for a better name
> are welcome.

Naming is hard... here are some ideas (none of them very good):

- execute-extended-command-here
- execute-extended-command-narrow
- execute-extended-command-mode
- execute-extended-command-local

(BTW, why is `execute-extended-command' not just `execute-command'?
I'm not suggesting that we change it, it just seems like a strange choice.)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]