From: Guillermo J. Rozas Date: Wed, 23 Sep 1992 23:03:55 +0000 (+0000) Subject: Split comint into history manipulation and subprocess manipulation. X-Git-Tag: 20090517-FFI~8924 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=a7d2ab522c4efcc1f4f21f5a9cacbe80935d6985;p=mit-scheme.git Split comint into history manipulation and subprocess manipulation. History is used by intmod, but the rest is not available under DOS. --- diff --git a/v7/src/edwin/comint.scm b/v7/src/edwin/comint.scm index 55723fe8c..09af66d15 100644 --- a/v7/src/edwin/comint.scm +++ b/v7/src/edwin/comint.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/comint.scm,v 1.13 1992/03/13 10:05:26 cph Exp $ +$Id: comint.scm,v 1.14 1992/09/23 23:03:42 jinx Exp $ -Copyright (c) 1991-92 Massachusetts Institute of Technology +Copyright (c) 1991-1992 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -91,12 +91,7 @@ Good choices: This is a good thing to set in mode hooks." "^") -(define-variable-per-buffer comint-input-ring-size - "Size of input history ring." - 30) - (define-variable comint-last-input-end "" false) -(define-variable comint-input-ring "" false) (define-variable comint-program-name "File name of program that is running in this buffer." @@ -220,80 +215,6 @@ history list. Default is to save anything that isn't all whitespace." (not (re-match-string-forward (re-compile-pattern "\\`\\s *\\'" false) false (ref-variable syntax-table) string)))) -(define-command comint-previous-input - "Cycle backwards through input history." - "*p" - (lambda (argument) - (let ((point (current-point)) - (ring (ref-variable comint-input-ring))) - (let ((size (+ (ring-size ring) 1))) - (let ((index - (modulo (+ argument - (command-message-receive comint-input-ring-tag - (lambda (index) - (delete-string (current-mark) point) - index) - (lambda () - (push-current-mark! point) - (cond ((positive? argument) 0) - ((negative? argument) 2) - (else 1))))) - size))) - (message (number->string index)) - (if (positive? index) - (insert-string (ring-ref ring (- index 1)) point)) - (set-command-message! comint-input-ring-tag index)))))) - -(define comint-input-ring-tag - '(COMINT-INPUT-RING)) - -(define-command comint-next-input - "Cycle forwards through input history." - "*p" - (lambda (argument) - ((ref-command comint-previous-input) (- argument)))) - -(define-variable comint-last-input-match "" false) - -(define-command comint-history-search-backward - "Search backwards through the input history for a matching substring." - (lambda () - (list (prompt-for-string "History search backward" - (ref-variable comint-last-input-match)))) - (lambda (string) - (comint-history-search string true))) - -(define-command comint-history-search-forward - "Search forwards through the input history for a matching substring." - (lambda () - (list (prompt-for-string "History search forward" - (ref-variable comint-last-input-match)))) - (lambda (string) - (comint-history-search string false))) - -(define (comint-history-search string backward?) - (let ((ring (ref-variable comint-input-ring)) - (syntax-table (ref-variable syntax-table)) - (pattern (re-compile-pattern (re-quote-string string) false))) - (let ((size (+ (ring-size ring) 1))) - (let ((start - (command-message-receive comint-input-ring-tag - (lambda (index) index) - (lambda () (if backward? 0 size))))) - (let loop ((index start)) - (let ((index (+ index (if backward? 1 -1)))) - (cond ((if backward? (>= index size) (< index 0)) - (set-command-message! comint-input-ring-tag start) - (editor-failure "Not found")) - ((re-search-string-forward pattern - false - syntax-table - (ring-ref ring (- index 1))) - (set-variable! comint-last-input-match string) - ((ref-command comint-previous-input) (- index start))) - (else - (loop index))))))))) - (define-command comint-previous-similar-input "Reenter the last input that matches the string typed so far. If repeated successively, older inputs are reentered. diff --git a/v7/src/edwin/make.scm b/v7/src/edwin/make.scm index 16bdcada4..ae6ec7ba0 100644 --- a/v7/src/edwin/make.scm +++ b/v7/src/edwin/make.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/make.scm,v 3.73 1992/08/27 06:48:09 jinx Exp $ +$Id: make.scm,v 3.74 1992/09/23 23:03:22 jinx Exp $ Copyright (c) 1989-1992 Massachusetts Institute of Technology @@ -40,4 +40,4 @@ MIT in each case. |# "edwin" `((os-type . ,(intern (microcode-identification-item 'OS-NAME-STRING)))) 'QUERY) -(add-system! (make-system "Edwin" 3 72 '())) \ No newline at end of file +(add-system! (make-system "Edwin" 3 74 '())) \ No newline at end of file diff --git a/v7/src/edwin/process.scm b/v7/src/edwin/process.scm index d8a6862b1..75631221a 100644 --- a/v7/src/edwin/process.scm +++ b/v7/src/edwin/process.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/process.scm,v 1.24 1992/05/12 02:43:41 cph Exp $ +;;; $Id: process.scm,v 1.25 1992/09/23 23:03:55 jinx Exp $ ;;; -;;; Copyright (c) 1991-92 Massachusetts Institute of Technology +;;; Copyright (c) 1991-1992 Massachusetts Institute of Technology ;;; ;;; This material was developed by the Scheme project at the ;;; Massachusetts Institute of Technology, Department of @@ -43,9 +43,12 @@ ;;; ;;;; Subprocess Support +;; package: (edwin process) (declare (usual-integrations)) +(define subprocesses-available? true) + (define (initialize-processes!) (set! edwin-processes '()) (let ((path (get-environment-variable "PATH")))