minad-emacs

joined 11 months ago
[–] minad-emacs@alien.top 1 points 9 months ago

It is not only fragile, it is also wrong, since the default completion UI even deletes duplicate candidates.

[–] minad-emacs@alien.top 1 points 9 months ago (6 children)

/u/hvis Would you consider changing this, since this way of deduplication in the frontend is quite inefficient? Given that the default completion UI demands that candidates are unique with respect to equal and even deletes equal duplicates, the backend should better produce unique candidates.

Deduplicating in the backend is not difficult, all that is needed is adding a suffix like (1), (2), (3), ... In fact, this is what I am doing in my Consult package, which also is a backend and provides completion tables. For example for the consult-line command I was facing the same issue, that candidates must be unique with respect to equal and not to eq.

cc /u/JDRiverRun

[–] minad-emacs@alien.top 1 points 10 months ago

See https://github.com/minad/consult/issues/378 where this has been discussed before. One can write a command copying the current word at point in the buffer into the minibuffer.

[–] minad-emacs@alien.top 1 points 11 months ago

They do for commands that are defined with the ivy and helm framework. The downside of course is that everything has to be rewritten using their frameworks in order to have first class support.

Yes, exactly.

This is also necessary if you want other features such as actions...

No this is not necessary. Embark supports actions for commands based on completing-read.

[–] minad-emacs@alien.top 1 points 11 months ago (2 children)

One should also mention the relatively new vertico-suspend command. It takes a different approach via recursive minibuffers, but has its own limitations.

I would guess that vertico is not always able to repeat extended commands properly and so they are disabled by default.

No, see my other answer.

Unfortunately, if you must have such a feature in full generality, I'd recommend that you use helm or ivy instead.

Ivy and Helm do not support repeating arbitrary completion sessions in full generality - because it is hardly possible. Only the state of commands which go through the ivy-read or helm API can be fully reconstructed.

[–] minad-emacs@alien.top 1 points 11 months ago

execute-extended-command is excluded for the reason that I didn't find it useful to repeat. If you type M-x you get the recently used commands sorted to the top anyway. As an often executed command, M-x pollutes the vertico-repeat-history. You can browse the history with vertico-repeat-select. But if you dislike this default, it is easy to customize it.