1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-21 07:30:50 -08:00

Fix 'partial-completion' for candidates containing newlines

'partial-completion' tries to match a pattern containing wildcards
(such as `any' or `prefix') against completion candidates.
Wildcards are supposed to match any sequence of characters, but
'completion-pcm--pattern->regex' transformed the wildcards into
".*", which won't match sequences containing newlines.  Fix this to
properly match anything by using "[^z-a]*" instead.
(That's (rx (* anything)).)
* lisp/minibuffer.el (completion-pcm--pattern->regex): Fix
regex.  (Bug#72425)
This commit is contained in:
Spencer Baugh 2024-08-02 12:15:58 -04:00 committed by Eli Zaretskii
parent 62067d2ae7
commit 7b60a25328

View file

@ -3948,7 +3948,7 @@ or a symbol, see `completion-pcm--merge-completions'."
(t
(let ((re (if (eq x 'any-delim)
(concat completion-pcm--delim-wild-regex "*?")
".*?")))
"[^z-a]*?")))
(if (if (consp group) (memq x group) group)
(concat "\\(" re "\\)")
re)))))