-
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
Vertico Prescient: Change how candidates are remembered. #156
Conversation
0822fed
to
0d8452b
Compare
This looks quite solid to me. I suggest to move most of the remember code (the hooks etc) to prescient.el and then only configure the trigger commands in vertico-prescient.el, such that the generic parts are reusable and the integration packages are as thin as possible. |
Thank you for the PR! I can confirm that this fixes the unexpected behavior I pointed out in #155. |
I will try that. There is the new |
- Fix radian-software#155, remembering candidates when entering a new directory with `vertico-directory-enter`. - Remember candidates on minibuffer exit as well as candidate insertion. - Add Compat (https://github.com/emacs-compat/compat) as a dependency. It is already a dependency of Vertico. - Add stub file `stub/compat.el`. - Remove `vertico-prescient--remember`. - Add `vertico-prescient--remember-minibuffer-contents`. If completing a file name, only remember the last component of the file path, since that is the actual candidate. If the candidate is a directory, include the trailing directory separator. - Add `vertico-prescient--insertion-commands` and `vertico-prescient--remember-inserted-candidate` for remembering in `post-command-hook`. - Add `vertico-prescient--remember-exited-candidate` and `vertico-prescient--exit-commands` for remembering in `minibuffer-exit-hook`. - Hook `vertico-prescient--setup-remembrance` into `minibuffer-setup-hook`.
For time reasons, I've decided to investigate simplifying that part later in favor of fixing this particular bug now. Does anyone want any changes to how this is written, outside of generalizing it later? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've got no objections!
Fix
vertico-directory
does not behave as expected when used alongsidevertico-prescient-mode
#155, remembering candidates when entering a new directorywith
vertico-directory-enter
.Remember candidates on minibuffer exit as well as candidate
insertion.
Remove
vertico-prescient--remember
.Add
vertico-prescient--remember-minibuffer-contents
. Ifcompleting a file name, only remember the last component of
the file path, since that is the actual candidate. If the candidate
is a directory, include the trailing directory separator.
Add
vertico-prescient--insertion-commands
andvertico-prescient--remember-inserted-candidate
for rememberingin
post-command-hook
.Add
vertico-prescient--remember-exited-candidate
andvertico-prescient--exit-commands
for remembering inminibuffer-exit-hook
.Hook
vertico-prescient--setup-remembrance
intominibuffer-setup-hook
.