emacs-diffs
[Top][All Lists]
Advanced

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

master 7b62cda: Fix warning in completion-pcm--optimize-pattern


From: Lars Ingebrigtsen
Subject: master 7b62cda: Fix warning in completion-pcm--optimize-pattern
Date: Mon, 1 Mar 2021 16:38:26 -0500 (EST)

branch: master
commit 7b62cda96e69c34cf51f300c02a08f5ea2bbb486
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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 aacb8ab..cd81f0f 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 7349b19..791e51c 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



reply via email to

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