diff options
| author | Lars Ingebrigtsen | 2021-03-01 22:38:17 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-03-01 22:38:17 +0100 |
| commit | 7b62cda96e69c34cf51f300c02a08f5ea2bbb486 (patch) | |
| tree | 1f66ef14826e2792eedd1993f74914def150e764 | |
| parent | e5392d38ac27c4cf1674997ab38a453877e65109 (diff) | |
| download | emacs-7b62cda96e69c34cf51f300c02a08f5ea2bbb486.tar.gz emacs-7b62cda96e69c34cf51f300c02a08f5ea2bbb486.zip | |
Fix warning in completion-pcm--optimize-pattern
* lisp/minibuffer.el (completion-pcm--optimize-pattern): Remove
unused variable.
| -rw-r--r-- | lisp/minibuffer.el | 2 | ||||
| -rw-r--r-- | test/lisp/minibuffer-tests.el | 6 |
2 files changed, 7 insertions, 1 deletions
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'." | |||
| 3162 | (let ((n '())) | 3162 | (let ((n '())) |
| 3163 | (while p | 3163 | (while p |
| 3164 | (pcase p | 3164 | (pcase p |
| 3165 | (`(,(or 'any 'any-delim) ,(or 'any 'point) . ,rest) | 3165 | (`(,(or 'any 'any-delim) ,(or 'any 'point)) |
| 3166 | (setq p (cdr p))) | 3166 | (setq p (cdr p))) |
| 3167 | ;; This is not just a performance improvement: it turns a | 3167 | ;; This is not just a performance improvement: it turns a |
| 3168 | ;; terminating `point' into an implicit `any', which affects | 3168 | ;; 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 @@ | |||
| 125 | '(("completion1" "prefix1" #("suffix1" 0 7 (face shadow))))) | 125 | '(("completion1" "prefix1" #("suffix1" 0 7 (face shadow))))) |
| 126 | (should (equal (get-text-property 19 'face) 'shadow)))) | 126 | (should (equal (get-text-property 19 'face) 'shadow)))) |
| 127 | 127 | ||
| 128 | (ert-deftest completion-pcm--optimize-pattern () | ||
| 129 | (should (equal (completion-pcm--optimize-pattern '("buf" point "f")) | ||
| 130 | '("buf" point "f"))) | ||
| 131 | (should (equal (completion-pcm--optimize-pattern '(any "" any)) | ||
| 132 | '(any)))) | ||
| 133 | |||
| 128 | (provide 'minibuffer-tests) | 134 | (provide 'minibuffer-tests) |
| 129 | ;;; minibuffer-tests.el ends here | 135 | ;;; minibuffer-tests.el ends here |