From: Stephen Adams Date: Fri, 9 Sep 1994 01:23:34 +0000 (+0000) Subject: Added M-x grep. Sorry, no error parsing yet. X-Git-Tag: 20090517-FFI~7119 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=005bfd259e3bec58930c1030b336ea4207d6d677;p=mit-scheme.git Added M-x grep. Sorry, no error parsing yet. --- diff --git a/v7/src/edwin/compile.scm b/v7/src/edwin/compile.scm index 16ea7e6ad..676c126fd 100644 --- a/v7/src/edwin/compile.scm +++ b/v7/src/edwin/compile.scm @@ -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))))) (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