From bc68ac8604c6b57224ab57306f384a6085580d08 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 26 Aug 1999 18:20:44 +0000 Subject: [PATCH] Fix FOO-flush-output so that it works right when the output doesn't start with a newline. --- v7/src/edwin/comint.scm | 13 ++++++++++--- v7/src/edwin/intmod.scm | 9 +++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/v7/src/edwin/comint.scm b/v7/src/edwin/comint.scm index b03863d6b..4ea7e2e69 100644 --- a/v7/src/edwin/comint.scm +++ b/v7/src/edwin/comint.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: comint.scm,v 1.29 1999/08/10 16:54:57 cph Exp $ +$Id: comint.scm,v 1.30 1999/08/26 18:20:39 cph Exp $ Copyright (c) 1991-1999 Massachusetts Institute of Technology @@ -291,12 +291,19 @@ With negative arg, newer inputs are reentered." "Kill all output from interpreter since last input." () (lambda () - (let ((start (mark1+ (ref-variable comint-last-input-end) 'LIMIT)) + (let ((start + (mark-left-inserting-copy + (let ((start (ref-variable comint-last-input-end))) + (if (eqv? #\newline (extract-right-char start)) + (mark1+ start) + start)))) (end (line-start (comint-process-mark) 0))) (if (< (mark-index start) (mark-index end)) (begin (delete-string start end) - (insert-string "*** output flushed ***\n" start)))))) + (guarantee-newline start) + (insert-string "*** output flushed ***\n" start))) + (mark-temporary! start)))) (define (comint-process-mark) (let ((buffer (selected-buffer))) diff --git a/v7/src/edwin/intmod.scm b/v7/src/edwin/intmod.scm index b564a66b8..ee7bb61de 100644 --- a/v7/src/edwin/intmod.scm +++ b/v7/src/edwin/intmod.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: intmod.scm,v 1.99 1999/02/24 21:59:07 cph Exp $ +;;; $Id: intmod.scm,v 1.100 1999/08/26 18:20:44 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-1999 Massachusetts Institute of Technology ;;; @@ -555,7 +555,11 @@ If this is an error, the debugger examines the error condition." "Kill all output from REPL since last input." () (lambda () - (let ((start (mark1+ (ref-variable comint-last-input-end) 'LIMIT)) + (let ((start + (let ((start (ref-variable comint-last-input-end))) + (if (eqv? #\newline (extract-right-char start)) + (mark1+ start) + start))) (end (port/mark (buffer-interface-port (selected-buffer) #t)))) (let ((value-mark (re-search-backward flush-output-regexp end start #f))) @@ -564,6 +568,7 @@ If this is an error, the debugger examines the error condition." (if (mark< start end) (begin (delete-string start end) + (guarantee-newline start) (insert-string "*** output flushed ***\n" start))) (if value-mark (let ((m -- 2.25.1