emacs-devel
[Top][All Lists]
Advanced

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

RE: [External] : Re: Stepping Back: A Wealth Of Completion systems Re: [


From: Drew Adams
Subject: RE: [External] : Re: Stepping Back: A Wealth Of Completion systems Re: [ELPA] New package: vertico
Date: Fri, 9 Apr 2021 17:22:13 +0000

> then one would also need a feature in the completion
> system which locks the current candidate set...
>
> probably Icicles supports something like this
> out of the box?

Yes.  `S-SPC' puts you in a recursive minibuffer,
where you can provide a new pattern, which is then
matched against the candidates that matched the
previous pattern.  This is an "AND" operation
(intersection).

As usual, whatever you type is matched on the fly:
as you change the pattern, the matching candidates
change.  But all of them match the pattern you
used for the parent minibuffer.

You can exit any minibuffer level and continue
with its parent.  So the "locking in" doesn't
lock once and for all.  It just has the effect of
exploring, in a new minibuffer, the candidates
that are current when you hit `S-SPC'.

When you end that exploration (whether or not you
acted on any candidates there) you can return to
the parent minibuffer and continue where you left off.

Or not.  You can "finally" choose a candidate in
a child minibuffer and thus end completion
altogether.  Or you can "finally" end without
choosing any candidate at any level.

So this is related to the ability to act on
(multiple) candidates without ending completion.
This is part of what makes Icicles useful for
exploration/discovery.

[You can also go in the other direction, ORing
(union) instead of ANDing, using `S-backspace'
instead of `S-SPC'.  That's more limited; it
essentially just ORs a new pattern you enter.]

> The idea is basically to lock the candidate
> set and switch between completion styles.

In Icicles it's completely decoupled from any
switch of completion styles.  You can switch
completion-style lists anytime, and you need
not switch when you use `S-SPC' to prompt for
a new, independent match pattern.

You can use multiple different patterns, and
each can be matched using any list of
completion styles.

You can make use of the completion styles of
vanilla Emacs, but you're not limited to any
styles or any set (list) of them.

Emacs's notion and use of completion styles
has this important limitation:

All completion candidates you see come from
the same style.  You have no control over
which style will actually be used for any
given input, other than ordering the list
ahead of time.

And you have no way of knowing which style
was actually used to produce a given set of
candidates.  The relation between your input
pattern and the matches is thus sometimes not
so clear.

There's no way to know, for example, that
initial matching failed and partial matching
succeeded.

Sometimes you might not care what style
matched.  If your only aim is to obtain some
candidate, in whatever way, then Emacs style
lists might suffice.

That's apparently the sole design aim: maximize
the possibility of getting a match.  In that, I
guess it's tied to the aim of completing, and
divorced from any aim of finding out whether a
given pattern (e.g. of a given kind) matches.

That difference is perhaps relevant for the
distinction of "completing" from "selecting"
introduced in this thread by the OP.

In vanilla Emacs, the current set (list) of
`completion-styles' can only be used together
- it's all or none; they're never alternatives
that you can choose among at runtime.

Besides supporting completion styles, Icicles
lets you choose (anytime) among completion
_methods_, which are alternatives.  Only one
method is used at a time.

Method `vanilla' just uses the current set of
completion styles, which, as in vanilla Emacs,
means try one style after the other until one
succeeds at matching or none do.

But even for completion styles Icicles offers
choice.  You can define multiple style sets,
with option `icicle-completion-style-sets'.
During completion you change to another set
(list).

Among other things, this means you can try to
complete using one style set and, if that fails,
switch to another.  Any of the sets can contain
any number of styles, in any order.

In particular, a set can be a singleton, which
means that you can selectively try to complete
using different individual styles.  That is,
you can use individual styles, like methods,
as alternatives.

Icicles thus gives you more flexibility than
vanilla Emacs for using completion styles.  But
completion methods are used more than styles.

> This feature does not seem to be available
> in the Emacs completion mechanism directly.

Right.

Progressive completion:

https://www.emacswiki.org/emacs/Icicles_-_Progressive_Completion

Completion methods and styles:

https://www.emacswiki.org/emacs/Icicles_-_Completion_Methods_and_Styles


reply via email to

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