Mercurial > emacs
changeset 108743:4b1caf0bded6
* progmodes/grep.el (grep-read-files): Fix multi-pattern aliases.
Remove "all" from grep-files-aliases. Split grep-files-aliases by
whitespace, call wildcard-to-regexp on substrings and concat them
with "\\|". (Bug#6114)
author | Juri Linkov <juri@jurta.org> |
---|---|
date | Fri, 21 May 2010 23:43:04 +0300 |
parents | 36dd9f97c404 |
children | ce6895773462 141ddbd4a5e0 |
files | lisp/ChangeLog lisp/progmodes/grep.el |
diffstat | 2 files changed, 14 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Fri May 21 19:51:48 2010 +0000 +++ b/lisp/ChangeLog Fri May 21 23:43:04 2010 +0300 @@ -1,3 +1,10 @@ +2010-05-21 Juri Linkov <juri@jurta.org> + + * progmodes/grep.el (grep-read-files): Fix multi-pattern aliases. + Remove "all" from grep-files-aliases. Split grep-files-aliases by + whitespace, call wildcard-to-regexp on substrings and concat them + with "\\|". (Bug#6114) + 2010-05-21 Alan Mackenzie <acm@muc.de> * progmodes/cc-engine.el (c-parse-state-get-strategy): Replace
--- a/lisp/progmodes/grep.el Fri May 21 19:51:48 2010 +0000 +++ b/lisp/progmodes/grep.el Fri May 21 23:43:04 2010 +0300 @@ -781,12 +781,17 @@ (file-name-nondirectory bn))) (default-alias (and fn - (let ((aliases grep-files-aliases) + (let ((aliases (remove (assoc "all" grep-files-aliases) + grep-files-aliases)) alias) (while aliases (setq alias (car aliases) aliases (cdr aliases)) - (if (string-match (wildcard-to-regexp (cdr alias)) fn) + (if (string-match (mapconcat + 'wildcard-to-regexp + (split-string (cdr alias) nil t) + "\\|") + fn) (setq aliases nil) (setq alias nil))) (cdr alias))))