]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix 'partial-completion' for candidates containing newlines
authorSpencer Baugh <sbaugh@janestreet.com>
Fri, 2 Aug 2024 16:15:58 +0000 (12:15 -0400)
committerEshel Yaron <me@eshelyaron.com>
Fri, 16 Aug 2024 06:44:45 +0000 (08:44 +0200)
'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)

lisp/minibuffer.el

index c8f149bb455af7050d69531f1c650b69f8ea97fd..2ed61bd24ac0cb1af49c217979bac6d4cb6248da 100644 (file)
@@ -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)))))