-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create vertico-prescient-mode
and corfu-prescient-mode
.
#131
Conversation
This is great, thank you. I will migrate Radian to use it after merge. |
80f5aa6
to
448b086
Compare
I think you should bind them there. Changing the filtering on the fly should work with Corfu. Regarding the completion-styles - I would make sure that the Vertico prescient mode only applies its overrides in the minibuffer. Likewise the Corfu overrides should be applied only locally in the buffer where corfu-mode is enabled. Then the settings won't interfere. |
@okamsn Any update here? |
Corfu can be enabled in any buffer, in contrast to Vertico which is always in the mini buffer. The candidates are stored in a local variable in the current buffer. |
Better that I ask, what do you think is the best way to have a toggling command's changes to the prescient.el variables only affect Corfu completion for the current completion session? For Selectrum and Vertico, we just make the variables local to the minibuffer. With how the toggling commands are currently written, the variables are made local to buffer in which Corfu is used and the change persists after the Corfu pop-up is closed. |
Take a look at the Corfu source :) The local variables holding the Corfu state are destroyed during teardown, see: https://github.com/minad/corfu/blob/99d3a0c8a626db1ff5832b013b2e50352613dd2d/corfu.el#L1096 |
I haven't looked through in detail, since I think you know what you are doing, but I would be more than happy to offer advice if there is any point that I could help with! I think the questions on Corfu and Vertico I am not knowledgeable to answer. |
55fdae7
to
6a0cf94
Compare
I think that's everything. Are there any final comments/requests before I merge this? |
@okamsn This looks great! Thanks for the cleanup, such that the code is shared between the different modes. |
@okamsn I went over the code and added a few comments. |
@okamsn Is this ready? |
I think so, unless there are any further requests/comments. |
Okay. Looks good to me! |
- Create files `vertico-prescient.el` and `corfu-prescient.el`. - Add stub definitions for Vertico and Corfu. - Make the `selectrum-prescient-toggle-*` commands more generic and move them to `prescient.el`. - Add variable `prescient--toggle-refresh-functions` and function `prescient--toggle-refresh`. The toggle commands run this hook to refresh the UI. Integration packages add functions to this hook. - Add variables `prescient--completion-recommended-styles` and `prescient--completion-recommended-overrides`, which are the default values for the completion settings used by the integration modes. - Candidates are remembered using `substring-no-properties`.
@okamsn Thanks! Can you please also update the Vertico migration guide accordingly? |
I will do this once the package becomes available on MELPA. |
vertico-prescient.el
andcorfu-prescient.el
.selectrum-prescient-toggle-*
commands more generic and move them toprescient.el
.prescient--toggle-refresh-functions
and functionprescient--toggle-refresh
. The toggle commands run this hook to refresh the UI. Integration packages add functions to this hook.prescient-create-toggling-command
from the existingprescient-create-and-bind-toggling-command
.prescient-completion-mode
. This minor mode will handle the completion settings shared byvertico-prescient-mode
andcorfu-prescient-mode
.TODO