[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Recommendation for CAPF setup when you don't know completion string
From: |
Daniel Mendler |
Subject: |
Re: Recommendation for CAPF setup when you don't know completion string in advance |
Date: |
Tue, 11 May 2021 16:37:42 +0200 |
On 5/11/21 6:04 AM, Stefan Monnier wrote:
> There's `completion-table-with-context`.
> Note that it comes with the following:
>
> ;; TODO: add `suffix' maybe?
>
> so you probably won't be able to use it as-is and you'll need to write
> your function instead. But hopefully it should be enough to get
> you started. It shouldn't be terribly hard.
>
> I think one problem you may encounter is that in the default UI,
> selecting an entry from *Completions* (e.g. with a middle click) will
> probably throw away the "suffix" (i.e. the text after the end of the
> boundary).
> If so, I suggest you `M-x report-emacs-bug` (tho maybe I did fix this
> one already; but there might be a few other such corner cases where we
> throw away the text after the end of the boundary).
I didn't follow the discussion here, but there is one thing I noticed -
the throw away of the suffix.
In my Vertico and Corfu packages I have the following problematic
behavior, which is also present in the default completion (I copied the
comment verbatim from vertico.el):
;; XXX There is a small bug here, depending on interpretation. When
;; completing "~/emacs/master/li|/calc" where "|" is the cursor,
;; then the returned candidate only includes the prefix
;; "~/emacs/master/lisp/", but not the suffix "/calc". Default
;; completion has the same problem when selecting in the
;; *Completions* buffer.
Is it non-intentional that the suffix is thrown away? I accidentally
replicated this behavior in Vertico and Corfu, but wasn't sure if this
is how it is actually meant to be.
Daniel