From 2f26a2266a3354606167a7f01df031bca8d727e9 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 13 Jul 2010 10:42:42 +0200 Subject: [PATCH] ctrl-d with readline exits one recursive repl instance * module/ice-9/buffered-input.scm (make-buffered-input-port): Instead of always returning EOF once EOF is seen once, call the producer again. Allows Ctrl-D to cause one EOF at the REPL, returning once from a recursive edit, but input continues normally. Thanks to Andrew Bagdanov for a clue that led to the fix. --- THANKS | 1 + module/ice-9/buffered-input.scm | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/THANKS b/THANKS index 403ff974a..9e18e5986 100644 --- a/THANKS +++ b/THANKS @@ -21,6 +21,7 @@ Contributors since the last release: For fixes or providing information which led to a fix: David Allouche + Andrew Bagdanov Martin Baulig Fabrice Bauzac Sylvain Beucler diff --git a/module/ice-9/buffered-input.scm b/module/ice-9/buffered-input.scm index 05e9255c0..c35fdb87e 100644 --- a/module/ice-9/buffered-input.scm +++ b/module/ice-9/buffered-input.scm @@ -64,7 +64,10 @@ with @var{continuation?} set to @code{#t}." (lambda () (cond ((eof-object? read-string) - read-string) + (let ((eof read-string)) + (set! read-string "") + (set! string-index -1) + eof)) ((>= string-index (string-length read-string)) (set! string-index -1) (get-character))