Icicles - Apropos Completions

iciclesimage
Previous: Icicles - Traversing Minibuffer HistoriesIciclesIciclesIndexNext: Icicles - Expanded-Common-Match Completion

Apropos Completions

Besides the prefix completion that is carried out by ‘TAB’, and which is similar to vanilla Emacs completion, Icicles offers another way to complete your partial input in the minibuffer.

This is similar in effect to using command ‘apropos’ to find the “apropos completions” of a string (except it works also for file and buffer names), so that’s the term I use for this: apropos completion.

Just as with prefix completion, Icicles lets you cycle among the apropos candidates. To do this, you use keys ‘next’ and ‘prior’ (labeled PageDown and PageUp on many keyboards). The root that was completed is underlined in the minibuffer completion candidate.

For example, suppose you use ‘M-x’ to enter a command. You do not remember the exact command name, but it has something to do with lines, so you type ‘M-x line’, then hit ‘next’ repeatedly until you see the right “line” command – ‘transpose-lines’, perhaps. Vanilla prefix completion does not find this command, because “line” is not a prefix of “transpose-lines”.

Because ‘M-x’ expects a command name, only command names are inserted into the minibuffer as the apropos-completion candidates for ‘M-x’. Likewise, in other contexts, where names of other kinds of object are expected, apropos completion inserts only names of objects of the appropriate type. Prefix completion works the same way.

For example, using ‘next’ and ‘prior’ with ‘C-x b at’ lets you cycle through all buffers (such as ‘*scratch*’) that have “at” in their name – only buffer names appear as candidates.

As an alternative to using ‘next’ to cycle forward, you can hit ‘S-TAB’ (‘S-tab’) repeatedly. Similarly, for prefix completion you can repeat ‘TAB’ to cycle forward. If you prefer, you can think of “apropos completion” as ‘S-TAB’ completion (but you can change which key effects it. See Prefix And Apropos Completion.

Apropos completion uses a regular expression (regexp) as its input string. You can type `M-x \bes’, for instance, to find commands with “es” at the start of a word within the command name (`\b’ matches the start of a word). It will find `eshell-test’ and `color-theme-blue-eshell’, but not ‘count-lines’ – “es” does not start a word in ‘count-lines’. Similarly, for file names, buffer names, and so on.

What if you want to see the list of all completion candidates that match the minibuffer input? Instead of cycling candidates blindly, just hit ‘S-TAB’ (Shift TAB) at any time to display the matching candidates in pop-up buffer ‘*Completions*’. This is analogous to ‘TAB’ for prefix completion.

(The documentation always refers to the key that performs apropos completion as ‘S-TAB’. Actually, it is ‘S-TAB’ only by default. You can customize it, using option `icicle-apropos-complete-keys’.)

Everything said in Icicles - Cycling Completions about the ‘*Completions*’ buffer for prefix completion is also true for apropos completion. It is updated to reflect the current set of matching candidates, and the current completion is highlighted. The root that was completed is highlighted within each candidate (first occurrence only). Root highlighting is more important in the case of apropos completion, because the match position is different in different candidates. In the case of apropos completion, the root is not the input string, taken literally, but the part of a candidate that the input matches. See Icicles - Completions Display for additional ways to use the minibuffer with ‘*Completions*’.

Regexp matching one of the most powerful features of Icicles. Enjoy! Explore! You can at any time switch back and forth between prefix completion (‘end’, ‘home’), apropos completion (‘next’, ‘prior’), and input history traversal (‘M-n’, ‘M-p’).

Here is a screenshot showing apropos completion and cycling in the minibuffer. It corresponds to input ‘M-x minib S-TAB’ followed by hitting ‘next’ several times.

iciclesscreenshot

This screenshot shows several Icicles features:

See also:


Previous: Icicles - Traversing Minibuffer HistoriesIciclesIciclesIndexNext: Icicles - Expanded-Common-Match Completion

DrewsElispLibraries referenced here: Lisp:icicles.el, Lisp:icomplete+.el

CategoryCommands CategoryCompletion CategoryRegexp CategoryDocumentation CategoryHelp CategoryProgrammerUtils