From d0afff349efb346e3a4339f4a831af53f1c6878b Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 1 May 2006 09:33:10 +0000 Subject: [PATCH] (grep-expand-template): Use save-match-data. --- lisp/progmodes/grep.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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." -- 2.39.5