]> git.eshelyaron.com Git - emacs.git/commitdiff
(grep-expand-template): Use save-match-data.
authorKim F. Storm <storm@cua.dk>
Mon, 1 May 2006 09:33:10 +0000 (09:33 +0000)
committerKim F. Storm <storm@cua.dk>
Mon, 1 May 2006 09:33:10 +0000 (09:33 +0000)
lisp/progmodes/grep.el

index 7d8cc9d5c6406f3c1203deb8ef5e24e2643099e6..0aba9d42b84633f1b3f0a38a90539653270b985c 100644 (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."