-
Notifications
You must be signed in to change notification settings - Fork 17
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
Use thing-at-point for initial input of completing-read #6
Conversation
I can see why someone might prefer this behavior, but the initial input can be a nuisance depending on your configuration and workflow (I for one wouldn't want this). What would be an acceptable change is to include an optional Also, note that this package is on GNU ELPA, so FSF copyright assignment is required to accept a contribution, unless you haven't contributed to Emacs or other GNU ELPA packages and the PR remains below 15 lines. Is this the case for you? |
Adding an I haven't signed a CLA at the moment, but like you said, the PR is below 15 lines. |
Yes, I noticed the weird first candidate in your screenshot. Which completion UI is this? I've tested with Ivy and Vertico, and this doesn't happen. You are not supposed to be able to choose |
I'm using Ivy. I tried it again with (progn
(add-to-list 'load-path "~/.emacs.d/elpa/ivy-20210602.1349/")
(add-to-list 'load-path "~/.emacs.d/elpa/devdocs-20210618.1621/")
(require 'ivy)
(require 'devdocs)
(ivy-mode))
;; call devdocs-lookup ...
When I eval the following snippet while Ivy is active, I get the same behavior: (completing-read "test: " '("A" "B" "C" "D")
nil
t
nil
nil
"thing-at-point") |
I can reproduce the problem with Ivy version 0.13 (the latest release), so it's not a recent issue. AFAICS it's perfectly reasonable to supply history/default items that don't match a candidate even when |
After looking at the Ivy implementation in more detail, I understand what the problem is. Using the I guess this use case isn't really supported by Ivy at the moment. |
I added the |
All right, looks good. Can you append
to the commit message, to keep the record? |
Copyright-paperwork-exempt: yes
Yes, done. |
Thanks! |
Thank you for this package, it's really useful.
This PR changes the
completing-read
call indevdocs--read-entry
. The symbol at point is now used for theINITIAL-INPUT
parameter instead of theDEF
parameter. This causes the completion to be already narrowed when the completion buffer is visible. The following screenshots show the difference:Before:
After: