From: Juri Linkov Date: Fri, 21 May 2010 20:43:04 +0000 (+0300) Subject: * progmodes/grep.el (grep-read-files): Fix multi-pattern aliases. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~205^2~12 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=df9db1517ed4957c143edd0d6216214f463dd0c0;p=emacs.git * 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) --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7c0fb21483f..e59c4a45c29 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2010-05-21 Juri Linkov + + * 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 * progmodes/cc-engine.el (c-parse-state-get-strategy): Replace diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index de94620c737..3f5fa543813 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -781,12 +781,17 @@ substitution string. Note dynamic scoping of variables.") (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))))