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
completion-at-point #42
Comments
I agree, that default interface looks pretty icky (I had never used |
Try this from my (currently private) package ;) (defun citre-completion-in-region (start end collection &optional predicate)
"A function that replace default `completion-in-region-function'.
This completes the text between START and END using COLLECTION.
PREDICATE says when to exit.
When there are multiple candidates, this uses standard
`completing-read' interface, while the default one in Emacs pops
a *Completions* buffer to show them. When combined with some
minibuffer completion framework, it's more user-friendly then the
default one.
Notice when `completing-read-function' is
`completing-read-default' (i.e., not enhanced by a minibuffer
completion framework), this falls back to
`completion--in-region'."
(if (eq completing-read-function #'completing-read-default)
(completion--in-region start end collection predicate)
(let* ((str (buffer-substring-no-properties start end))
(completion-ignore-case (string= str (downcase str)))
(candidates
(nconc
(completion-all-completions str collection predicate (- end start))
nil))
(completion nil))
(pcase (length candidates)
(0 (message "No completions"))
(1 (setq completion (car candidates)))
(_ (setq completion (completing-read (format "(%s): " str)
candidates predicate t))))
(when completion
(delete-region start end)
(insert (substring-no-properties completion)))))) and set |
@AmaiKinono Would you be alright with my making some amendments and then including a version of your code in Selectrum? |
Of course ;) Please do it. And, I have some suggestions. A completion-at-point-function backend can have an |
I haven't implemented any extensions at this time, but would be happy to see a pull request. |
I feel like ya'll were reading my mind. I went through the pain of setting up Company so I could use completions from LSP without the terrible default completion framework...this is all I wanted, to select completions using Selectrum. Thank you! 😍 |
This thread is being closed automatically by Tidier because it is labeled with "waiting on response" and has not seen any activity for 90 days. But don't worry—if you have any information that might advance the discussion, leave a comment and I will be happy to reopen the thread :) |
I wonder if it's possible to use selectrum for
completion-at-point
? It's pretty much "magically" took over all selection inputs, except this one: it shows a new buffer withcompletion-list-mode
.The text was updated successfully, but these errors were encountered: