[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 3 readline bugs: source positions, readline-options, endless loop on
Re: 3 readline bugs: source positions, readline-options, endless loop on error
Thu, 25 Jan 2001 19:12:04 +0100 (MET)
On Thu, 25 Jan 2001, Martin Grabmueller wrote:
> I modified the `set-readline-*put-port!' procedures (see below), but
> got two questions:
> - How can I test whether a given port is a file port? The problem is
> that my patch works when you pass a stupid value like #t to the
> procedures, but not for string ports, for example. They lead to the
> same endless loop like before the patch.
I solved this problem by providing a file-port? primitive. Your patch is
in cvs now. However, we still run into endless loops if either the soft
port which performs the readline line buffering, or the underlying file
port is closed.
Try (close-input-port (current-input-port)) when using readline, and you
will see the problem.
A solution to this problem could be to capture all errors occuring in
(read) within the readline module, and, for example, issue an error
message there, but return <eof> to the calling code. This, however, will
mean that the calling code will assume that ctrl-d was pressed and thus
the application will be terminated.
Since I don't know what would be the right thing, I will ignore this
problem unless someone else can tell me how to handle the problem.