mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 18:40:39 -08:00
(completion-pcm--pattern->regex): When completion-ignore-case is
non-nil, generate a regexp that ignores case.
This commit is contained in:
parent
36f95f7755
commit
1353c8da70
1 changed files with 11 additions and 6 deletions
|
|
@ -1381,12 +1381,17 @@ or a symbol chosen among `any', `star', `point'."
|
||||||
(mapconcat
|
(mapconcat
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
(case x
|
(case x
|
||||||
((star any point)
|
((star any point)
|
||||||
(if (if (consp group) (memq x group) group)
|
(if (if (consp group) (memq x group) group)
|
||||||
"\\(.*?\\)" ".*?"))
|
"\\(.*?\\)"
|
||||||
(t (regexp-quote x))))
|
".*?"))
|
||||||
pattern
|
(t
|
||||||
""))))
|
(if (and completion-ignore-case
|
||||||
|
(string-match "[[:alpha:]]" x))
|
||||||
|
(format "[%s%s]" (downcase x) (upcase x))
|
||||||
|
(regexp-quote x)))))
|
||||||
|
pattern
|
||||||
|
""))))
|
||||||
;; Avoid pathological backtracking.
|
;; Avoid pathological backtracking.
|
||||||
(while (string-match "\\.\\*\\?\\(?:\\\\[()]\\)*\\(\\.\\*\\?\\)" re)
|
(while (string-match "\\.\\*\\?\\(?:\\\\[()]\\)*\\(\\.\\*\\?\\)" re)
|
||||||
(setq re (replace-match "" t t re 1)))
|
(setq re (replace-match "" t t re 1)))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue