From: Spencer Baugh Date: Fri, 2 Aug 2024 16:15:58 +0000 (-0400) Subject: Fix 'partial-completion' for candidates containing newlines X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6286971e1a7bed654c4500634f55db2f29cf4406;p=emacs.git 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) (cherry picked from commit 7b60a2532895ebda2db2798767cbaff049032edb) --- diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index c8f149bb455..2ed61bd24ac 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -4913,7 +4913,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)))))