unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: emacs-devel@gnu.org
Subject: Re: Limit what M-x TAB lists?
Date: Fri, 27 Dec 2013 02:41:58 +0100	[thread overview]
Message-ID: <87zjnn9ijd.fsf@building.gnus.org> (raw)
In-Reply-To: 87sitfcww4.fsf@building.gnus.org

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
predicate. 

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




  reply	other threads:[~2013-12-27  1:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-26 14:18 Limit what M-x TAB lists? Lars Ingebrigtsen
2013-12-26 14:58 ` Stefan Monnier
2013-12-26 15:24   ` Lars Ingebrigtsen
2013-12-26 16:03     ` Óscar Fuentes
2013-12-26 16:09       ` Lars Ingebrigtsen
2013-12-26 17:50         ` Stefan Monnier
2013-12-26 18:03           ` Lars Ingebrigtsen
2013-12-27  1:41             ` Lars Ingebrigtsen [this message]
2014-01-03 18:00               ` Ted Zlatanov
2014-01-06 15:47             ` Davis Herring
2014-01-18 17:43               ` Lars Ingebrigtsen
2013-12-26 17:50 ` Tom
2014-01-11 21:07   ` Nix
2014-01-11 23:38     ` Drew Adams
2013-12-27  7:29 ` Stephen J. Turnbull

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zjnn9ijd.fsf@building.gnus.org \
    --to=larsi@gnus.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).