Editor-peek-no-hang timeout. Inferior event hooks.
authorMatt Birkholz <matt@birkholz.chandler.az.us>
Mon, 17 Jan 2011 08:56:12 +0000 (01:56 -0700)
committerMatt Birkholz <matt@birkholz.chandler.az.us>
Thu, 2 Jun 2011 17:39:51 +0000 (10:39 -0700)
commite5a645d9eac9449b9a7cea172bce1d907fee431f
tree031ba2e99c06851e69e92e6f4210de8fbcfcbbb8
parent3c5c50697e7f26c1e7ecd3d1b80b7bab0445c227
Editor-peek-no-hang timeout.  Inferior event hooks.

Moved the busy-wait loop in keyboard-read-1 into each editor-peek-no-
hang method.  The gtk-screen method can then provide a version that
blocks for the specified timeout.

Added hooks to be called when inferior threads and processes are ready
with input events.

* src/edwin/bufwin.scm: Moved generalization of buffer-window/redraw!
into %clear-window-incremental-redisplay-state! -- the only part not
useful to a gtk-screen.  Genericized it by doing nothing for gtk
screens.

* src/edwin/editor.scm (hook/signal-inferior-thread-output!): Added
this hook so that gtk-screen can get inferior threads to signal the
editor thread with an event other than #f.  The tty screens' innermost
editor mainloops test the inferior-thread-changes? flag and return an
input event; they just need a wake-up.  The gtk-screen substitutes a
procedure that directly queues the input event and thus wakes the
editor thread.

* src/edwin/image.scm (group-line-image!, substring-line-image!): New,
for parsing and imaging lines in one step.

* src/edwin/: edwin.pkg, input.scm (keyboard-peek-busy-no-hang): New.
The common, busy-waiting implementation of peek-no-hang, used in the
various tty screens.

(keyboard-peek-no-hang): The editor-peek-no-hang method now requires a
timeout argument.

(keyboard-read-1): Eliminate the wait loop.  Rely on the editor-peek-
no-hang methods.

* src/edwin/: os2term.scm, tterm.scm, win32.scm, xterm.scm: Use
keyboard-peek-busy-no-hang to implement a timeout argument for the
original editor-peek-no-hang method.

* src/edwin/process.scm (register-process-input): Call the new
hook/inferior-process-output whenever an inferior process goes on the
process-input-queue.  Gtk-screen uses this to queue an input event for
the editor thread, so that it will accept the (all!) inferior process
output.
src/edwin/bufwin.scm
src/edwin/editor.scm
src/edwin/edwin.pkg
src/edwin/image.scm
src/edwin/input.scm
src/edwin/os2term.scm
src/edwin/process.scm
src/edwin/tterm.scm
src/edwin/win32.scm
src/edwin/xterm.scm