emacs-devel
[Top][All Lists]
Advanced

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

RE: [External] : Re: [PATCH] Re: Other details about completion.


From: Drew Adams
Subject: RE: [External] : Re: [PATCH] Re: Other details about completion.
Date: Wed, 6 Apr 2022 20:01:12 +0000

> > 1. Cycling highlights the current candidate and
> > puts it in the minibuffer, replacing whatever was
> > there - always.
> 
> Thanks, this means by default it could insert the current candidate.

There's no "current" candidate till you cycle (or
otherwise select a candidate).

> > (A key clears the minibuffer; and
> >  a key restores previous content.)
> 
> I wonder why a special key to clear the minibuffer
> when it's easy to type 'C-a C-k' or 'M-h DEL'.


(This is independent of _completion_, BTW - it's
about any minibuffer.)


1. Neither `C-a C-k' nor `M-h DEL' clears all
minibuffer content, which can be anything, including
any number of lines of text.  `C-a C-k' clears only
the current line.  And `M-h DEL' clears only the
paragraph before point.

(A more useful command for removing a bunch of
minibuffer text, but not necessarily all, is
`backward-kill-sexp' - e.g., `C-M-backspace'.)


2. Clearing the minibuffer is very frequent,
especially when various other minibuffer-content
manipulations are added to the mix.

In particular, Icicles has multi-commands, where a
single command invocation can invoke the command
(or carry out other actions) on multiple completion
candidates.  So it's not unusual to stay in the
minibuffer, performing different editing operations,
including changing the current input to complete
against different sets or kinds of candidates.

Similarly, for progressive completion, where you
complete against a set of completions using
different patterns, progressively narrowing the set. 


3. `M-S-delete' and `M-S-backspace' clear the
minibuffer.  But `M-k' is what you usually use.

It too clears the minibuffer content.  But if you're
currently using (e.g. cycling) a minibuffer history,
it deletes the current history element.

[There's also `M-K', which prompts you for history
entries to delete, or with `C-u' deletes the whole
history (current history variable).]


4. As for keys restoring previous minibuffer content:

a. `C-l' restores last minibuffer input (repeatable).

This includes text you _entered_ (e.g. with `RET'),
i.e., what's in a minibuffer history.

But it also includes input you type in the minibuffer
during completion, but that you don't enter (`RET').

It includes candidates you've cycled and text you've
typed or deleted in the minibuffer - e.g., editing of
a candidate you cycled into the minibuffer.

Editing remembers what's in the minibuffer as your
last real "input".  If you want to replace a cycled
candidate and go back to editing the input you had
typed before cycling, use `C-l' (instead of just
deleting chars from the cycled candidate).

Input you type during completion but you don't enter
(e.g. `RET') is remembered because you might want to
retrieve it.  This can be because you cycled among
candidates or because completing has expanded your
input in some way.

[By default, your input is automatically to the
_common match_ among all matching candidates.  You
can use `C-l' to remove that expansion, leaving just
what completion of a single (the current) candidate
produces.]

For example, suppose you use `C-h v hook' to examine
various hook variables, and you use cycle through
their doc (e.g. `C-down').  If you end the command
with `C-g', so your input (`hook') is never really
entered (`RET'), then it's not in the minibuffer
history (e.g. `M-p').  Nevertheless, in a subsequent
command you can retrieve it - with `C-l'.

b. `C-L' (aka `C-S-l') does the same as `C-l', but
with reverse chronology.

c. An option lets `C-l' and `C-L' use completion,
instead of cycling, to retrieve a past input (in the
sense above).  Just as with cycling with these keys,
a previous input replaces the minibuffer content.
This uses a recursive minibuffer, so you can cancel
it with `C-g'.  (`C-l' or `C-L' with a prefix arg
flips cycling vs completion.)
 



reply via email to

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