-
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-directory
does not behave as expected when used alongside vertico-prescient-mode
#155
Comments
cc @okamsn |
The problem seems to be these:
|
I believe that a simple solution would be if Vertico ran a special hook that received that relevant candidate in the public commands and that those public commands would run a simpler internal version without the hook. However, that complicates Vertico for the needs of (probably only) Prescient. I believe that @minad rejected this idea in the past. @minad, do you have any thoughts on receiving the string inserted by |
I'm now of the opinion that a hook isn't needed. I think that a simpler solution would be if the user-facing commands were wrappers for the implementations, and that the user-facing commands only used the implementations, and not other user-facing commands. For example, I will create a PR to see if this idea has any traction. |
@okamsn Would it be possible to use a post-command-hook/minibuffer-exit-hook in the minibuffer? It could run after all the relevant commands and record the minibuffer content. Ideally this would even work for other UIs like the default completion UI. (Unrelated, but also hooking into the sorting functionality of Vertico seems not necessary, since completion styles can use completion--adjust-meta-data to provide their own sorting routine. Maybe most of the vertico-prescient code could be made more generic?) |
- 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. - 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`.
- 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. - 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`.
- 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`.
- 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`.
- 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`.
I've tried that in PR #156. @leungbk, would you please try the changes made in PR #156 and see if it works for you? It now uses the function
We did it the current way so that the sorting was applied even if the |
- 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`.
- 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`.
- 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`.
- Fix #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`.
Repro:
emacs -q -l my-init.el
mkdir foo
C-x C-f foo RET RET
to exit fromfind-file
into adired
buffer.dired
buffer, press^
to re-enter the parent directory.C-x C-f
again.After step 5,
foo
is not at the top of the completions list; however, when usingvertico-directory
withoutvertico-prescient-mode
on, performing the same experiment leads tofoo
appearing at the top of the completions.The text was updated successfully, but these errors were encountered: