|
From: | Daniel Mendler |
Subject: | Re: [ELPA] New package: vertico |
Date: | Sat, 10 Apr 2021 11:33:32 +0200 |
On 4/10/21 9:17 AM, Tassilo Horn wrote:
But note that Vertico is fully compatible with default completion, so as you observed you can just use `minibuffer-complete`. If you bind `minibuffer-complete` to the `vertico-map` it will work. See https://github.com/minad/vertico#keymap. Is that good enough or do you have something else in mind?It's just almost good enough. It completes correctly but the candidates are not refreshed. For example, with find-file, it might complete uniquely to a directory but still display the siblings of that directory rather than its contents. That's why I've sneaked in a call to `vertico--exhibit' in my `th/vertico--complete' command.
If you bind `minibuffer-complete` to a keybinding in `vertico-map` it will automatically update the UI via the `post-command-hook`, which calls `vertico--exhibit`.
I have checked your aggressive-completion package and there you are using a timer. I wonder why you are doing that (Performance issues?). Wouldn't it be better to use an `after-change-function` or a `post-command-hook`? If you use a `post-command-hook`, it will work automatically with Vertico as long as your `post-command-hook` which aggressively calls `minibuffer-complete` runs before my `vertico--exhibit` hook.
If you continue to use a timer, you necessarily have to inform the Vertico UI that something has changed. As I said, Vertico only updates itself via the `post-command-hook` and does not detect other changes. So as things stand, there is no other way than calling `vertico--exhibit` manually. With Icomplete the situation should be the same, see `icomplete-exhibit`. If your package works well with Icomplete it should also work well with Vertico and vice versa.
Daniel Mendler
[Prev in Thread] | Current Thread | [Next in Thread] |