Fix warning in completion-pcm--optimize-pattern

* lisp/minibuffer.el (completion-pcm--optimize-pattern): Remove
unused variable.
This commit is contained in:
Lars Ingebrigtsen
2021-03-01 22:38:17 +01:00
parent e5392d38ac
commit 7b62cda96e
2 changed files with 7 additions and 1 deletions

View File

@@ -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

View File

@@ -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