From: Chong Yidong Date: Mon, 1 Sep 2008 21:34:23 +0000 (+0000) Subject: (completion-pcm--pattern->regex): When completion-ignore-case is X-Git-Tag: emacs-pretest-23.0.90~3085 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1353c8da70b3854d123731a3093ef034528a3755;p=emacs.git (completion-pcm--pattern->regex): When completion-ignore-case is non-nil, generate a regexp that ignores case. --- diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index a59fac6d556..163bebb5028 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -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)))