1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

(grep-expand-template): Use save-match-data.

This commit is contained in:
Kim F. Storm 2006-05-01 09:33:10 +00:00
parent 820f5fec97
commit d0afff349e

View file

@ -581,8 +581,13 @@ substitution string. Note dynamic scoping of variables.")
(case-fold-search nil))
(dolist (kw grep-expand-keywords command)
(if (string-match (car kw) command)
(setq command (replace-match (or (eval (cdr kw)) "")
t t command))))))
(setq command
(replace-match
(or (if (symbolp (cdr kw))
(eval (cdr kw))
(save-match-data (eval (cdr kw))))
"")
t t command))))))
(defun grep-read-regexp ()
"Read regexp arg for interactive grep."