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


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Dmitry Gutov <dmitry <at> gutov.dev>
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: bug#48356: 28.0.50; choose-completion discards the suffix after the completion boundary
Date: Tue, 09 Apr 2024 22:38:59 -0400
>>> ...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.


        Stefan





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.