diff options
| author | Chong Yidong | 2008-09-01 21:34:23 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-09-01 21:34:23 +0000 |
| commit | 1353c8da70b3854d123731a3093ef034528a3755 (patch) | |
| tree | 5d670d655501a2ebef989ce818ae16c46e210ca3 | |
| parent | 36f95f7755beb3fb0065470e1b8954a575893745 (diff) | |
| download | emacs-1353c8da70b3854d123731a3093ef034528a3755.tar.gz emacs-1353c8da70b3854d123731a3093ef034528a3755.zip | |
(completion-pcm--pattern->regex): When completion-ignore-case is
non-nil, generate a regexp that ignores case.
| -rw-r--r-- | lisp/minibuffer.el | 17 |
1 files changed, 11 insertions, 6 deletions
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'." | |||
| 1381 | (mapconcat | 1381 | (mapconcat |
| 1382 | (lambda (x) | 1382 | (lambda (x) |
| 1383 | (case x | 1383 | (case x |
| 1384 | ((star any point) | 1384 | ((star any point) |
| 1385 | (if (if (consp group) (memq x group) group) | 1385 | (if (if (consp group) (memq x group) group) |
| 1386 | "\\(.*?\\)" ".*?")) | 1386 | "\\(.*?\\)" |
| 1387 | (t (regexp-quote x)))) | 1387 | ".*?")) |
| 1388 | pattern | 1388 | (t |
| 1389 | "")))) | 1389 | (if (and completion-ignore-case |
| 1390 | (string-match "[[:alpha:]]" x)) | ||
| 1391 | (format "[%s%s]" (downcase x) (upcase x)) | ||
| 1392 | (regexp-quote x))))) | ||
| 1393 | pattern | ||
| 1394 | "")))) | ||
| 1390 | ;; Avoid pathological backtracking. | 1395 | ;; Avoid pathological backtracking. |
| 1391 | (while (string-match "\\.\\*\\?\\(?:\\\\[()]\\)*\\(\\.\\*\\?\\)" re) | 1396 | (while (string-match "\\.\\*\\?\\(?:\\\\[()]\\)*\\(\\.\\*\\?\\)" re) |
| 1392 | (setq re (replace-match "" t t re 1))) | 1397 | (setq re (replace-match "" t t re 1))) |