Correctly include fixed strings before a prefix wildcard in PCM
authorSpencer Baugh <sbaugh@janestreet.com>
Mon, 26 Aug 2024 14:12:51 +0000 (10:12 -0400)
committerEli Zaretskii <eliz@gnu.org>
Sat, 14 Sep 2024 09:24:08 +0000 (12:24 +0300)
commit3cda1fdc3b755dd329617cabc266e2b86894d0cb
tree4e575f4fdbacb5a47f351a418fc21e94cdd33958
parent57d93d0259a3cc9a180b1bcb3cec3f670485f82c
Correctly include fixed strings before a prefix wildcard in PCM

In 03ac16ece40ba3e3ba805d6a61cc457d84bf3792 I fixed a bug with the
PCM implementation of substring completion, relating to the handling
of PCM wildcards.
However, this fix was incomplete.  This change completes the fix by
also including a fixed string if it appears before a 'prefix'
wildcard, even if 'try-completion' doesn't discover that fixed
string grows to a unique completion.
I discovered this bug while working on enhancements to PCM
completion related to 'completion-pcm-leading-wildcard'.
* lisp/minibuffer.el (completion-pcm--merge-completions): Include
fixed strings before 'prefix wildcard.  (Bug#72819)
* test/lisp/minibuffer-tests.el (completion-substring-test-5): Add a
test for this behavior.
lisp/minibuffer.el
test/lisp/minibuffer-tests.el