From 74028d1d2c9263567f4bdbb379bc8c1a69851555 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 16 Oct 1993 05:57:46 +0000 Subject: [PATCH] Recognize patterned prompts that should print in the Scheme buffer. --- etc/xscheme.el | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/etc/xscheme.el b/etc/xscheme.el index 04e3ba458..7a52ffb75 100644 --- a/etc/xscheme.el +++ b/etc/xscheme.el @@ -1,5 +1,5 @@ ;; Run Scheme under Emacs -;; Copyright (C) 1986, 1987, 1989, 1990, 1991 Free Software Foundation, Inc. +;; Copyright (C) 1986-93 Free Software Foundation, Inc. ;; This file is part of GNU Emacs. @@ -20,7 +20,7 @@ ;;; Requires C-Scheme release 5 or later ;;; Changes to Control-G handler require runtime version 13.85 or later -;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/etc/xscheme.el,v 1.30 1993/01/29 12:54:51 gjr Exp $ +;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/etc/xscheme.el,v 1.31 1993/10/16 05:57:46 cph Exp $ (require 'scheme) @@ -1110,25 +1110,16 @@ the remaining input.") (xscheme-guarantee-newlines 2)) (defun xscheme-coerce-prompt (string) - (if (string-match "^[0-9]+ " string) + (if (string-match "^[0-9]+ \\[[^]]+\\] " string) (let ((end (match-end 0))) - (concat (substring string 0 end) - (let ((prompt (substring string end))) - (let ((entry (assoc prompt xscheme-prompt-alist))) - (if entry - (cdr entry) - prompt))))) + (let ((prompt (substring string end))) + (xscheme-process-filter-output prompt) + (if (and (> (length prompt) 0) + (not (= (aref prompt (- (length prompt) 1)) ? ))) + (xscheme-process-filter-output " ")) + (substring string 0 (- end 1)))) string)) -(defvar xscheme-prompt-alist - '(("[Normal REPL]" . "[Evaluator]") - ("[Error REPL]" . "[Evaluator]") - ("[Breakpoint REPL]" . "[Evaluator]") - ("[Debugger REPL]" . "[Evaluator]") - ("[Visiting environment]" . "[Evaluator]") - ("[Environment Inspector]" . "[Where]")) - "An alist which maps the Scheme command interpreter type to a print string.") - (defun xscheme-cd (directory-string) (save-excursion (set-buffer (xscheme-process-buffer)) -- 2.25.1