GNU bug report logs - #48356
28.0.50; choose-completion discards the suffix after the completion boundary

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Tue, 11 May 2021 17:24:01 UTC

Severity: normal

Found in version 28.0.50

Full log


Message #60 received at 48356 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 48356 <at> debbugs.gnu.org, Daniel Mendler <mail <at> daniel-mendler.de>,
 JD Smith <jdtsmith <at> gmail.com>, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#48356: 28.0.50; choose-completion discards the suffix after
 the completion boundary
Date: Thu, 11 Apr 2024 04:00:35 +0300
On 10/04/2024 05:38, Stefan Monnier wrote:
>>>> ...which translates to "/" because of the double slash -- the filesystem
>>>>    root directory (*). But that's the same data which would be used by any
>>>>    other proposed solution, too.
>>> More or less, tho the "ideal" solution is to do that in the
>>> completion-style code, which has a bit more knowledge about it.
>> Doing it in completion-style, though, would either require a relatively
>> awkward change in most/all styles (e.g. the "new dynamic variable" route),
>> or a more straightforward change in styles together with an incompatible
>> change in completion-all-completions.
> 
> Yup, hence the quotes around "ideal".
> 
>> So on balance, would you say it's a good idea to a) use this approach in
>> minibuffer-completion-help, b) create a named function for it, for other
>> callers to take advantage of it as well?
> 
> Yes, while waiting for a new API it seems like a good stop gap.
> 
>> Looks like completion--merge-suffix is the helper to use.
> 
> Yup.
> 
>>> In theory this approach can "do the wrong thing" with some completion
>>> styles, but AFAIK they haven't been written yet.  🙂
>> So you figure that such theoretical style would return adjusted base-suffix
>> in -all-completions method, not just in -try-completion?
> 
> A completion style could make use of (and list) things after the
> boundary.  E.g. completing a file name like
> 
>      foo/ba<|>ar/baz
> 
> could decide to list all the files that match
> 
>      *f*o*o*/*b*a*a*r*/*b*a*z*
> 
> in which case the "end boundary" of the `completion-all-completions`
> output should not be the `cdr` of the `completion-boundaries`.
> 
> I wouldn't worry about it, tho.

All right, please see the new function completion-base-suffix added in 
0288bc6c949. Any docstring improvements (and others) are welcome.

I guess we should also mention it in NEWS...




This bug report was last modified 129 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.