diff lisp/progmodes/compile.el @ 33493:23d500c81118

(grep): `tag-default' can be nil.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 14 Nov 2000 19:30:53 +0000
parents e0870d1a8c33
children 98dd828601f2
line wrap: on
line diff
--- a/lisp/progmodes/compile.el	Tue Nov 14 18:52:08 2000 +0000
+++ b/lisp/progmodes/compile.el	Tue Nov 14 19:30:53 2000 +0000
@@ -609,20 +609,20 @@
      (unless grep-command
        (grep-compute-defaults))
      (when arg
-       (let* ((tag-default
-	       (funcall (or find-tag-default-function
-			    (get major-mode 'find-tag-default-function)
-			    ;; We use grep-tag-default instead of
-			    ;; find-tag-default, to avoid loading etags.
-			    'grep-tag-default))))
+       (let ((tag-default
+	      (funcall (or find-tag-default-function
+			   (get major-mode 'find-tag-default-function)
+			   ;; We use grep-tag-default instead of
+			   ;; find-tag-default, to avoid loading etags.
+			   'grep-tag-default))))
 	 (setq grep-default (or (car grep-history) grep-command))
 	 ;; Replace the thing matching for with that around cursor
 	 (when (string-match "[^ ]+\\s +\\(-[^ ]+\\s +\\)*\\(\"[^\"]+\"\\|[^ ]+\\)\\(\\s-+\\S-+\\)?" grep-default)
 	   (unless (or (match-beginning 3) (not (stringp buffer-file-name)))
 	     (setq grep-default (concat grep-default "*."
 					(file-name-extension buffer-file-name))))
-	   (setq grep-default (replace-match tag-default t t
-					       grep-default 2)))))
+	   (setq grep-default (replace-match (or tag-default "")
+					     t t grep-default 2)))))
      (list (read-from-minibuffer "Run grep (like this): "
 				 (or grep-default grep-command)
 				 nil nil 'grep-history))))