[Top][All Lists]

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

Re: Limit what M-x TAB lists?

From: Lars Ingebrigtsen
Subject: Re: Limit what M-x TAB lists?
Date: Fri, 27 Dec 2013 02:41:58 +0100
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux)

Here's another tweak:

We have (interactive) specs like before, and all those are listed in
M-x.  We add a new (command) spec, and those should be used only for
commands used in modes, like previously discussed.

Here's the tweak: Instead of adding a predicate, we just use the same
syntax as `interactive', i.e., (command "p") or whatever.  `M-x TAB'
will then list all `interactive' functions, plus all `command' functions
that are reachable in current keymaps.  So if we're in a vc-dir-mode
buffer, `M-x vc-dTAB' will list `vc-dir-mark', but otherwise not.

This has the advantage that 1) it's probably easier to implement, and 2)
commands that are available via text-property/overlay keymaps, as well
as minor modes, all do the right thing without any special handling.

And commands like `quit-window' would also "just work", even though it
"belongs" in a lot of different modes.

This is a 97% solution -- I think it almost gets us to where we want to
be.  But there are a handful of commands that are deliberately left out
of keymaps, but may still only be called in certain modes.  For these,
we could have another form that does include the previously discussed

(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/

reply via email to

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