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: Fri, 8 Apr 2022 16:20:08 +0000

> >So we have two possible cases: selecting a completion candidate
> >when the Completions buffer is the current buffer, and the second
> >case is when the minibuffer is current.  The first case now works fine,
> >and we need to improve the second case.  The new mode zcomplete-mode
> >will help to do this.
> 
> The advantage of using the minibuffer for everything as icomplete does
> is that there is no context switching, so it is a single case, single
> map etc... 

For every action, yes.  But Icomplete (like Ido) also
uses the minibuffer to display candidates.  A better
model is the standard Emacs one (also Icicles): show
in *Completions*, act in the minibuffer.

> The only limitation we have there then is that completins are
> not shown on demand, but automatically; but I am not sure if that is
> actually a bad or good thing...

It's both a good and a bad thing (should be obvious).
IOW, such a choice should be available to users at
preference-configuration time, or even on the fly,
not decided by Emacs designers at Emacs design time.

Icicles gives users the choice:

https://www.emacswiki.org/emacs/Icicles_-_Icompletion#IncrementalCompletion

1. An option for whether *Completions* is updated
   incrementally as you type.

2. Two options control the delay before automatic
   incremental completion takes effect: # of seconds
   to wait, which takes effect only when there are
   at least N candidates.  This lets you type ahead,
   before an candidate redisplay occurs.

#1 provides several possibilities (cycle with `C-#'):

   `t': Update *Completions* only if already displayed.

   `nil': Never update *Completions* automatically.
          Do so only on demand.

   Other non-nil: Show and update *Completions*
          whenever there's more than one candidate.

   `t' is the default: show *Completions* on demand,
   but once shown, automatically update it.  When
   there's only one candidate, remove it.

3. Another option says whether to show *Completions*
   even before you type any minibuffer input.  Useful
   in some contexts where it makes sense to show you
   the possibilities at the outset, like a menu.  Some
   users like this behavior all the time.

4. You can turn off incremental completion for a given
   command, by putting a non-nil property on its symbol
   (property `icicle-turn-off-incremental-completion').

5. Besides incremental completion in *Completions*,
   there's whether or not input is completed/expanded
   in the minibuffer.  (Cycle with `C-M-"'.)
___

Expansion (#5) is to the longest common match for all
candidates: a substring common to all candidates
matched by your input, but a substring that also
matches your input.  It's described here:

https://www.emacswiki.org/emacs/Icicles_-_Expanded-Common-Match_Completion

 0 - Never expand (similar to Ido).  Just look to
     *Completions* for the completions.  Fits well
     with non-nil & non-t value for #1, above.
 1 - Expand only on demand, when you ask to complete.
 2 - Like 1, but also expand when only one match.
 3 - Like 4, but don't expand for regexp completion.
 4 - Expand whenever completed in *Completions*.

3 & 4 are the most useful, I think.  Cycle with `C-"'.



reply via email to

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