Subject: Re: bug#74420: 31.0.50; PCM completion for ~/src/emacs/trunk/*/minibuf breaks

From: Stefan Monnier <[email-masked]>
Date: Mon, 18 Nov 2024 18:58:47 -0500

> 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?

>> 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.
🙁

        Stefan