emacs-devel
[Top][All Lists]
Advanced

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

Re: Limit what M-x TAB lists?


From: Stefan Monnier
Subject: Re: Limit what M-x TAB lists?
Date: Thu, 26 Dec 2013 09:58:25 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> Here's today's unrealistic idea: Wouldn't it be nice if `M-x fooTAB' was
> more useful?

Yes.  I rewrote M-x in Elisp, partly to try and make it easier for
people to try and tweak it.

> 2) New form like (command-interactive 'vc-mode "p")

More generally, move the "sanity checks" performed at the beginning of
some commands to a special place so they can be run without actually
calling the function.  IOW add a "callable" predicate alongside the
interactive-spec that M-x could then use to filter out
inapplicable commands.

Of course, this will require many changes in many packages before it
becomes really useful.

> 1) Just make M-x list ;;;###autoloaded functions.
> That would require us adding those cookies to more functions, though.

Not good enough.  Many commands are very useful via M-x but only after
loading a particular mode (those commands only make sense in that mode,
of course).

Maybe a related approach is to use a fancier analysis that tries to
figure out "would this command always be available in this context?" (as
opposed to being available because of some unrelated buffer having
caused some packages to be loaded).

Other ways we could try and improve M-x:
- Move to the beginning of the list, those commands that start with the
  same prefix as the current major mode.
- Move to the end of the list those commands that are accessible via
  a key-binding (and the shorter the key-binding, the further towards
  the end).


        Stefan



reply via email to

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