Added M-x grep. Sorry, no error parsing yet.
authorStephen Adams <edu/mit/csail/zurich/adams>
Fri, 9 Sep 1994 01:23:34 +0000 (01:23 +0000)
committerStephen Adams <edu/mit/csail/zurich/adams>
Fri, 9 Sep 1994 01:23:34 +0000 (01:23 +0000)
v7/src/edwin/compile.scm

index 16ea7e6ad15a8c1ae22d002691e2a3db4c447ba5..676c126fd103ba0eebb290625a2a4842040c2869 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: compile.scm,v 1.2 1992/11/16 22:40:55 cph Exp $
+;;;    $Id: compile.scm,v 1.3 1994/09/09 01:23:34 adams Exp $
 ;;;
 ;;;    Copyright (c) 1992 Massachusetts Institute of Technology
 ;;;
@@ -62,6 +62,16 @@ with output going to the buffer *compilation*."
     (set-variable! compile-command command)
     (run-compilation command)))
 
+(define-command grep
+  "Run grep, with user-specified args, and collect output in a buffer."
+  (lambda ()
+    (list (prompt-for-string "Run grep (with args): "
+                            previous-grep-arguments
+                            'INSERTED-DEFAULT)))
+  (lambda (command)
+    (set! previous-grep-arguments command)
+    (run-compilation (string-append "grep -n " command " /dev/null"))))
+
 (define-command kill-compilation
   "Kill the process made by the \\[compile] command."
   ()
@@ -69,6 +79,14 @@ with output going to the buffer *compilation*."
     (let ((process compilation-process))
       (if (and process (eq? (process-status process) 'RUN))
          (interrupt-process process true)))))
+
+(define-command kill-grep
+  "Kill the process made by the \\[grep] command."
+  ()
+  (lambda ()
+    (let ((process compilation-process))
+      (if (and process (eq? (process-status process) 'RUN))
+         (interrupt-process process true)))))
 \f
 (define (run-compilation command)
   ((ref-command save-some-buffers) false)
@@ -131,4 +149,7 @@ with output going to the buffer *compilation*."
   unspecific)
 
 (define compilation-process
-  false)
\ No newline at end of file
+  false)
+
+(define previous-grep-arguments
+  "")
\ No newline at end of file