Commit 670c5126 authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen

Remove unused internal function completion-pcm--optimize-pattern

* lisp/minibuffer.el (completion-pcm--optimize-pattern): Remove
unused internal function (that signalled a compilation warning).
parent a93e672e
Pipeline #1700 failed with stage
in 90 minutes and 2 seconds
......@@ -2971,28 +2971,6 @@ or a symbol, see `completion-pcm--merge-completions'."
;; It should be avoided properly, but it's so easy to remove it here.
(delete "" (nreverse pattern)))))
(defun completion-pcm--optimize-pattern (p)
;; Remove empty strings in a separate phase since otherwise a ""
;; might prevent some other optimization, as in '(any "" any).
(setq p (delete "" p))
(let ((n '()))
(while p
(pcase p
(`(,(and s1 (pred stringp)) ,(and s2 (pred stringp)) . ,rest)
(setq p (cons (concat s1 s2) rest)))
(`(,(and p1 (pred symbolp)) ,(and p2 (guard (eq p1 p2))) . ,_)
;; Unused lexical variable warning due to body not using p1, p2.
(setq p (cdr p)))
(`(star ,(pred symbolp) . ,rest) (setq p `(star . ,rest)))
(`(,(pred symbolp) star . ,rest) (setq p `(star . ,rest)))
(`(point ,(or 'any 'any-delim) . ,rest) (setq p `(point . ,rest)))
(`(,(or 'any 'any-delim) point . ,rest) (setq p `(point . ,rest)))
(`(any ,(or 'any 'any-delim) . ,rest) (setq p `(any . ,rest)))
(`(,(pred symbolp)) (setq p nil)) ;Implicit terminating `any'.
(_ (push (pop p) n))))
(nreverse n)))
(defun completion-pcm--pattern->regex (pattern &optional group)
(let ((re
(concat "\\`"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment