Don't optimize away star patterns in minibuffer file name completion

* lisp/minibuffer.el (completion-pcm--optimize-pattern): Keep
'star in the pattern (bug#41705).
This commit is contained in:
Pip Cet 2020-10-01 05:06:41 +02:00 committed by Lars Ingebrigtsen
parent c150b9a244
commit 59c343ba0d

View file

@ -3110,12 +3110,12 @@ or a symbol, see `completion-pcm--merge-completions'."
(while p
(pcase p
(`(,(or 'any 'any-delim) point . ,rest) (setq p `(point . ,rest)))
;; This is not just a performance improvement: it also turns
;; a terminating `point' into an implicit `any', which
;; affects the final position of point (because `point' gets
;; turned into a non-greedy ".*?" regexp whereas we need
;; it the be greedy when it's at the end, see bug#38458).
(`(,(pred symbolp)) (setq p nil)) ;Implicit terminating `any'.
;; This is not just a performance improvement: it turns a
;; terminating `point' into an implicit `any', which affects
;; the final position of point (because `point' gets turned
;; into a non-greedy ".*?" regexp whereas we need it to be
;; greedy when it's at the end, see bug#38458).
(`(point) (setq p nil)) ;Implicit terminating `any'.
(_ (push (pop p) n))))
(nreverse n)))