From: Daniel Mendler <mail@daniel-mendler.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: JD Smith <jdtsmith@gmail.com>, emacs-devel@gnu.org
Subject: Re: Recommendation for CAPF setup when you don't know completion string in advance
Date: Tue, 11 May 2021 18:10:12 +0200 [thread overview]
Message-ID: <091ea98f-bba5-60ce-e8e1-33c6d4eb6ac0@daniel-mendler.de> (raw)
In-Reply-To: <jwvv97pnu6c.fsf-monnier+emacs@gnu.org>
On 5/11/21 5:57 PM, Stefan Monnier wrote:
>> ;; 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 think the answer depends on the completion-style. IIRC some
> completion styles do that on purpose (in order to preserve/reproduce
> the behavior of earlier completion code), whereas I seem to remember
> a few cases where we may do something like that not on purpose (rather
> because of a bug, or out of laziness).
I see. There is some code in `choose-completion-string` which checks if
the length of the resulting string equals the car of the
`completion-boundaries`. When choosing a directory, the minibuffer is
not automatically exited. But the suffix string after the directory is
still thrown away. I don't see where the completion style is involved here.
The problem is probably that when appending the suffix the resulting
choice is not necessarily a valid candidate. This is at least how I
thought about it when replicating the behavior in Vertico/Corfu.
We could adjust the `choose-completion` behavior such that the suffix is
never thrown away and completion is never automatically exited when a
suffix exists. Would that make sense or did I miss something? Is this
worth a bug report/patch?
Daniel
next prev parent reply other threads:[~2021-05-11 16:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-03 22:23 Recommendation for CAPF setup when you don't know completion string in advance JD Smith
2021-04-03 23:49 ` Stefan Monnier
2021-04-04 2:52 ` JD Smith
2021-04-04 3:20 ` Stefan Monnier
2021-04-04 15:29 ` JD Smith
2021-05-11 3:33 ` JD Smith
2021-05-11 4:04 ` Stefan Monnier
2021-05-11 13:42 ` JD Smith
2021-05-11 15:52 ` Stefan Monnier
2021-05-11 14:37 ` Daniel Mendler
2021-05-11 15:57 ` Stefan Monnier
2021-05-11 16:10 ` Daniel Mendler [this message]
2021-05-11 16:54 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=091ea98f-bba5-60ce-e8e1-33c6d4eb6ac0@daniel-mendler.de \
--to=mail@daniel-mendler.de \
--cc=emacs-devel@gnu.org \
--cc=jdtsmith@gmail.com \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.