changeset 70315:cf0d76a2f0c7

(grep-expand-template): Use save-match-data.
author Kim F. Storm <storm@cua.dk>
date Mon, 01 May 2006 09:33:10 +0000
parents 51e6b0cc1bb1
children c1d19773499c
files lisp/progmodes/grep.el
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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."