all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: emacs-devel@gnu.org
Subject: Re: Limit what M-x TAB lists?
Date: Thu, 26 Dec 2013 09:58:25 -0500	[thread overview]
Message-ID: <jwvob43wtxz.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87bo03itkn.fsf@building.gnus.org> (Lars Ingebrigtsen's message of "Thu, 26 Dec 2013 15:18:48 +0100")

> 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	other threads:[~2013-12-26 14:58 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 [this message]
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
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

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

  git send-email \
    --in-reply-to=jwvob43wtxz.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.