emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master c7fdf86: * lisp/minibuffer.el: Avoid consecutive `any` in complet


From: Stefan Monnier
Subject: master c7fdf86: * lisp/minibuffer.el: Avoid consecutive `any` in completion patterns
Date: Mon, 28 Dec 2020 15:00:27 -0500 (EST)

branch: master
commit c7fdf8688388f137dbfab2f372fa33c24241b83a
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * 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>.
---
 lisp/minibuffer.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 7d05f77..c8c106c 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]