aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1998-06-01 03:08:53 +0000
committerKarl Heuer1998-06-01 03:08:53 +0000
commitd1208263cd848364650baafc62412528573f8a8d (patch)
treea25e50dd60b3d84ba363ecdc9c8ebb911462aa0d
parent4527adca6840d33a9a6574fd674443f107aa21a1 (diff)
downloademacs-d1208263cd848364650baafc62412528573f8a8d.tar.gz
emacs-d1208263cd848364650baafc62412528573f8a8d.zip
(grep): Fix previous change.
-rw-r--r--lisp/progmodes/compile.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index c74c2c570ca..6929e92708b 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -556,19 +556,21 @@ This command uses a special history list for its arguments, so you can
556easily repeat a grep command. 556easily repeat a grep command.
557 557
558A prefix argument says to default the argument based upon the current 558A prefix argument says to default the argument based upon the current
559tag the cursor is over." 559tag the cursor is over, substituting it into the last grep command
560in the grep command history (or into `grep-command'
561if that history list is empty)."
560 (interactive 562 (interactive
561 (let (grep-default) 563 (let (grep-default (arg current-prefix-arg))
562 (when (and current-prefix-arg grep-history) 564 (when arg
563 (let* ((tag-default 565 (let* ((tag-default
564 (funcall (or find-tag-default-function 566 (funcall (or find-tag-default-function
565 (get major-mode 'find-tag-default-function) 567 (get major-mode 'find-tag-default-function)
566 ;; We use grep-tag-default instead of 568 ;; We use grep-tag-default instead of
567 ;; find-tag-default, to avoid loading etags. 569 ;; find-tag-default, to avoid loading etags.
568 'grep-tag-default)))) 570 'grep-tag-default))))
569 (setq grep-default (car grep-history)) 571 (setq grep-default (or (car grep-history) grep-command))
570 ;; Replace the thing matching for with that around cursor 572 ;; Replace the thing matching for with that around cursor
571 (if (string-match "[^ ]+\\s +\\(-[^ ]+\\)*\\s *\\(\"[^\"]+\"\\|[^ ]+\\)" grep-default) 573 (if (string-match "[^ ]+\\s +\\(-[^ ]+\\s +\\)*\\(\"[^\"]+\"\\|[^ ]+\\)" grep-default)
572 (setq grep-default (replace-match tag-default t t 574 (setq grep-default (replace-match tag-default t t
573 grep-default 2))))) 575 grep-default 2)))))
574 (list (read-from-minibuffer "Run grep (like this): " 576 (list (read-from-minibuffer "Run grep (like this): "