From: Kim F. Storm Date: Mon, 1 May 2006 09:33:10 +0000 (+0000) Subject: (grep-expand-template): Use save-match-data. X-Git-Tag: emacs-pretest-22.0.90~2870 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d0afff349efb346e3a4339f4a831af53f1c6878b;p=emacs.git (grep-expand-template): Use save-match-data. --- diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 7d8cc9d5c64..0aba9d42b84 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -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."