Luke Gorrie luke@bluetail.com writes:
Alan Ruttenberg alanralanr@comcast.net writes:
openmcl (perhaps others) needs to add connection streams to a list to be periodically flushed so that output appears in emacs in a timely manner.
Is that actually needed? We already flush *standard-output* before returning from a RPC. Have you a test case where the current scheme fails?
I could redefine or advise create-connection and
close-connection but I think it might make more sense to make these methods and then I can define :around methods to do what needs to be done. Or you could add a hook.
Maybe the gray-streams code is the place for the hook? e.g. advising MAKE-FN-STREAMS and the close methods of those streams?
It would probably be good if *standard-output* where line buffered. Line buffering isn't difficult to implement for the gray streams, just a bit inefficient. Things are more complicated for the dedicated output stream case. The simplest solution for CMUCL/SBCL would be a 'buffering' argument to accept-connection, where buffering is either :full, :line, or :none. Don't now how to do the equivalent in OpenMCL, though. Any ideas?
We could implement the line buffering for the dedicated output stream with gray stream wrappers, but that's not very elegant.
Helmut.