Replies: 5 comments 8 replies
-
Hi. Thanks for the report. I had noticed this discussion before on the Emacs bug tracker. Vertico filters out duplicate candidates as in this case where the strings "Foo" are Instead of calling https://github.com/minad/corfu/blob/ec846c6aa373931508cc078b49a3a8ba8265c453/corfu.el#L607C1-L632C8 Would this solve the issue satisfactorily? I don't think this issue is particularily urgent, given that support for |
Beta Was this translation helpful? Give feedback.
-
You see, there is quite a bit of incoherence regarding duplicates, but
it is a real problem.
As long as we're using a completion API rather some new selection API,
my opinion is that duplicates should be eliminated. E.g. replace the
text property by some informative suffix. I can imagine circumstances
where this can be a problem, e.g. because the actual text is then
inserted in the buffer and we don't want the informative suffix in
there, but for Imenu this does not apply.
|
Beta Was this translation helpful? Give feedback.
-
`completing-read` is only about completion only as long as no candidates are
displayed. As soon as candidates are displayed, differentiating them via
selection becomes a possibility. At that point we are on the selection
pathway and we don't need another new API for that. **All** completion UIs
support such selection, the *Completions* buffer, or various other UIs like
the Icomplete or Vertico minibuffer menu.
Maybe the UIs do, but the API is not designed for that, so using
a completion table that relies on selection "increases friction".
In my Consult package the suffixes are noninformative and cryptic (Unicode
tofus). For such candidates, inserting them into a buffer is a problem,
arguably a worse one than if the suffixes are informative.
So, make them informative?
In the mean time, inserting them is a UI problem, and as you say, all
the UIs allow the users to "select". 🙂
It would be better to replace this mechanism with text properties plus
`retain-duplicates` completion metadata.
Except that, as you encountered, it bumps into various problems because
the infrastructure is designed for completion, not selection.
|
Beta Was this translation helpful? Give feedback.
-
I would prefer to replace this with a `retain-duplicates` metadatum.
I thank we made our positions clear, indeed.
Anyway, this discussion was about Imenu which has been modified in
Emacs 30 to use completion candidates with text properties, while the
`completing-read` infrastructure is not ready for this.
Right, I think this is best fixed in Imenu.
|
Beta Was this translation helpful? Give feedback.
-
Okay, how do you envision a selection API to look like and how should it
differ from completion, and also how do you envision the UI to look like?
I appreciate that the completion API can be used for completion and
selection under a unified API and under a unified UI.
I don't know, but I think the main one is that the return value would
have to be `eq` to one of the objects in the set of candidates.
Also I'd probably make it so the candidates can be objects of any type
and have some side-info about how to turn each candidate into
a human-palatable form.
|
Beta Was this translation helpful? Give feedback.
-
I'm attempting to use the Emacs 30 "imenu-flatten" setting configured for grouping in combination with Vertico. When I do this, Vertico doesn't show all of the candidates if there are multiple groups which contain a candidate with the same name. The following is a reproducer that can be used which demonstrates that when
vertico-mode
is not enabled, the default completion shows all entries, however whenvertico-mode
is enabled, there is a missing candidate.This is similar (but different) to an issue I reported on the Emacs bug mailing list here, which requires
completions-format
to be set tovertical
or the built-in completion has a similar issue (which hasn't been resolved).Beta Was this translation helpful? Give feedback.
All reactions