Commit 1353c8da authored by Chong Yidong's avatar Chong Yidong
Browse files

(completion-pcm--pattern->regex): When completion-ignore-case is

non-nil, generate a regexp that ignores case.
parent 36f95f77
......@@ -1381,12 +1381,17 @@ or a symbol chosen among `any', `star', `point'."
(mapconcat
(lambda (x)
(case x
((star any point)
(if (if (consp group) (memq x group) group)
"\\(.*?\\)" ".*?"))
(t (regexp-quote x))))
pattern
""))))
((star any point)
(if (if (consp group) (memq x group) group)
"\\(.*?\\)"
".*?"))
(t
(if (and completion-ignore-case
(string-match "[[:alpha:]]" x))
(format "[%s%s]" (downcase x) (upcase x))
(regexp-quote x)))))
pattern
""))))
;; Avoid pathological backtracking.
(while (string-match "\\.\\*\\?\\(?:\\\\[()]\\)*\\(\\.\\*\\?\\)" re)
(setq re (replace-match "" t t re 1)))
......
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