From 005bfd259e3bec58930c1030b336ea4207d6d677 Mon Sep 17 00:00:00 2001 From: Stephen Adams Date: Fri, 9 Sep 1994 01:23:34 +0000 Subject: [PATCH] Added M-x grep. Sorry, no error parsing yet. --- v7/src/edwin/compile.scm | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) 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 -- 2.25.1