From df9db1517ed4957c143edd0d6216214f463dd0c0 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Fri, 21 May 2010 23:43:04 +0300 Subject: [PATCH] * 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) --- lisp/ChangeLog | 7 +++++++ lisp/progmodes/grep.el | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) 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)))) -- 2.39.2