From 7b62cda96e69c34cf51f300c02a08f5ea2bbb486 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 1 Mar 2021 22:38:17 +0100 Subject: [PATCH] Fix warning in completion-pcm--optimize-pattern * lisp/minibuffer.el (completion-pcm--optimize-pattern): Remove unused variable. --- lisp/minibuffer.el | 2 +- test/lisp/minibuffer-tests.el | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index aacb8ab00bb..cd81f0f7286 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3162,7 +3162,7 @@ or a symbol, see `completion-pcm--merge-completions'." (let ((n '())) (while p (pcase p - (`(,(or 'any 'any-delim) ,(or 'any 'point) . ,rest) + (`(,(or 'any 'any-delim) ,(or 'any 'point)) (setq p (cdr p))) ;; This is not just a performance improvement: it turns a ;; terminating `point' into an implicit `any', which affects diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el index 7349b191caf..791e51cdcd5 100644 --- a/test/lisp/minibuffer-tests.el +++ b/test/lisp/minibuffer-tests.el @@ -125,5 +125,11 @@ '(("completion1" "prefix1" #("suffix1" 0 7 (face shadow))))) (should (equal (get-text-property 19 'face) 'shadow)))) +(ert-deftest completion-pcm--optimize-pattern () + (should (equal (completion-pcm--optimize-pattern '("buf" point "f")) + '("buf" point "f"))) + (should (equal (completion-pcm--optimize-pattern '(any "" any)) + '(any)))) + (provide 'minibuffer-tests) ;;; minibuffer-tests.el ends here -- 2.39.2