diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2020-12-28 14:58:39 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2020-12-28 14:58:39 -0500 |
commit | c7fdf8688388f137dbfab2f372fa33c24241b83a (patch) | |
tree | 04d4077c609099e133020603d20840a442d50184 /lisp | |
parent | 81969482e23b1c046354d9d860e548259f118b4e (diff) | |
download | emacs-c7fdf8688388f137dbfab2f372fa33c24241b83a.tar.gz emacs-c7fdf8688388f137dbfab2f372fa33c24241b83a.tar.bz2 emacs-c7fdf8688388f137dbfab2f372fa33c24241b83a.zip |
* lisp/minibuffer.el: Avoid consecutive `any` in completion patterns
(completion-pcm--optimize-pattern): Turn multiple consecutive
occurrences of `any` into just a single one.
Suggested by Dario Gjorgjevski <dario.gjorgjevski@gmail.com>.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/minibuffer.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 7d05f7704e9..c8c106c336a 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3159,7 +3159,8 @@ or a symbol, see `completion-pcm--merge-completions'." (let ((n '())) (while p (pcase p - (`(,(or 'any 'any-delim) point . ,rest) (setq p `(point . ,rest))) + (`(,(or 'any 'any-delim) ,(or 'any 'point) . ,rest) + (setq p (cdr p))) ;; 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 |