GNU bug report logs -
#74420
31.0.50; PCM completion for ~/src/emacs/trunk/*/minibuf breaks
Previous Next
Reported by: Spencer Baugh <sbaugh <at> janestreet.com>
Date: Mon, 18 Nov 2024 17:34:01 UTC
Severity: normal
Tags: patch
Found in version 31.0.50
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>> Actually... I just realized this misses some cases, namely when we have
>> "star point" or "point star".
>
> FWIW, my local patches have included for years optimizations like the
> ones you suggested *and* they replaced `star point` and `point star`
> with just `star`.
>
> Do you think it's important to preserve `point` in those cases?
Hm, I'm not sure. I've been playing around with alternative ways to
move point in pcm-try-completion but haven't yet got something I'm
satisfied with. So let me defer this question until I've hacked on that
some more :)
>>> BTW, maybe we should go with something like
>>>
>>> (`(,(and (pred symbolp) s1) ,(and (pred symbolp) s2) . ,rest)
>>> (cond ((completion-pcm--<something>-p s1 s2) (setq p (cons s1 rest)))
>>> ((completion-pcm--<something>-p s2 s1) (setq p (cons s2 rest)))
>>> (t (push (pop p) n))))
>>>
>>> Where `completion-pcm--<something>-p` is some kind of partial ordering?
>>
>> Interesting thought. Maybe it would make sense to have something like
>> - completion-pcm--wildcard-grows-on-left-p
>> (non-nil for star, point, any, any-delim)
>> - completion-pcm--wildcard-grows-on-right-p
>> (non-nil for star, point, prefix)
>> - completion-pcm--wildcard-in-text-p
>> (non-nil for star and point)
>> Then this case would be something like "if grows-left/right-p is the
>> same, and at most one of the symbols is in-text-p, delete the
>> non-in-text-p one".
>
> But I guess your `completion-pcm--merge-completions` is still needed as
> long as we can't optimize all sequences of symbols to a single symbol.
> 🙁
Yep. And here's one case that I think makes optimizing all sequences
down to a single symbol impossible: (star star star) is reified as ***,
not shrunk down to a single *. I think that behavior is probably
reasonable (or at least I'm not in any rush to get rid of it), but to
preserve it we have to preserve sequences of multiple symbols.
This bug report was last modified 99 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.