# HG changeset patch # User Kim F. Storm # Date 1146475990 0 # Node ID cf0d76a2f0c71164316f4a308feab6f9541abeca # Parent 51e6b0cc1bb17c2159d750f39191c6adb4ca5815 (grep-expand-template): Use save-match-data. diff -r 51e6b0cc1bb1 -r cf0d76a2f0c7 lisp/progmodes/grep.el --- a/lisp/progmodes/grep.el Mon May 01 09:32:59 2006 +0000 +++ b/lisp/progmodes/grep.el Mon May 01 09:33:10 2006 +0000 @@ -581,8 +581,13 @@ (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."