help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: [help-gnu-emacs] Searching for commands by any part of command name


From: Drew Adams
Subject: RE: [help-gnu-emacs] Searching for commands by any part of command name
Date: Thu, 8 Apr 2010 06:38:46 -0700

> Emacs command names can be confusing to newcomers and casual users,
> partly because of the word order in command names, and partly because
> users don't know how to specify the action (which begins the command
> name). For example, to close a window, you delete it.  I think it
> would be easier if it was possible to search commands
> case-insensitively and by text anywhere in the name, rather than only
> the beginning. For example, if a user types
> 
> M-x window <tab>
> 
> then Emacs would list commands including:
> 
> balance-windows
> buffer-menu-other-window
> clone-indirect-buffer-other-window
> compare-windows
> delete-other-windows
> delete-window
> 
> Can Emacs be customized or modified to do that?

Several 3rd-party packages allow this, and the latest Emacs vanilla version
allows it out of the box to some extent.

Here is one such package (which I maintain):
http://www.emacswiki.org/emacs/EmacsNewbieWithIcicles

To match against a substring (which is what you describe), use `S-TAB' for
completion instead of `TAB'. By default, `S-TAB' matching is actually regexp
(regular expression) matching, but if you want just substring matching (i.e. you
want to match regexp special chars literally), then just use `C-`' (once) in the
minibuffer - or just customize option `icicle-regexp-quote-flag' to non-nil.

Icicles completion works this way not just for command names but everything else
as well. And you can match multiple substrings without regard to order, so you
can match not only `window' but also `buffer', and thus pick up candidates like
`window-buffer' and `get-buffer-window' for `C-h f'. You do that by separating
the different match patterns with `S-SPC', so: `C-h f window S-SPC buffer
S-TAB'.

Other packages that also match substrings, and more info about completion in
general, are available here:
http://www.emacswiki.org/emacs/CategoryCompletion





reply via email to

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