[slime-cvs] CVS slime
trittweiler
trittweiler at common-lisp.net
Fri Jul 4 23:30:11 UTC 2008
Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv1365
Modified Files:
swank.lisp
Log Message:
* swank.lisp (call-with-redirected-io): Rebind only standard
streams if *GLOBALLY-REDIRECT-IO*. Fixes lost output after
disconnect, reconnect.
--- /project/slime/cvsroot/slime/swank.lisp 2008/04/17 14:56:43 1.543
+++ /project/slime/cvsroot/slime/swank.lisp 2008/07/04 23:30:10 1.544
@@ -1291,18 +1291,30 @@
(defun call-with-redirected-io (connection function)
"Call FUNCTION with I/O streams redirected via CONNECTION."
(declare (type function function))
- (let* ((io (connection.user-io connection))
- (in (connection.user-input connection))
- (out (connection.user-output connection))
- (trace (or (connection.trace-output connection) out))
- (*standard-output* out)
- (*error-output* out)
- (*trace-output* trace)
- (*debug-io* io)
- (*query-io* io)
- (*standard-input* in)
- (*terminal-io* io))
- (funcall function)))
+ (if *globally-redirect-io*
+ ;; Rebind the standard streams which isn't strictly necessary,
+ ;; but makes it easier to interpret (SETQ *STANDARD-OUTPUT* ...)
+ ;; and such in a repl transcript.
+ (let* ((*standard-output* *standard-output*)
+ (*error-output* *error-output*)
+ (*trace-output* *trace-output*)
+ (*debug-io* *debug-io*)
+ (*query-io* *query-io*)
+ (*standard-input* *standard-input*)
+ (*terminal-io* *terminal-io*))
+ (funcall function))
+ (let* ((io (connection.user-io connection))
+ (in (connection.user-input connection))
+ (out (connection.user-output connection))
+ (trace (or (connection.trace-output connection) out))
+ (*standard-output* out)
+ (*error-output* out)
+ (*trace-output* trace)
+ (*debug-io* io)
+ (*query-io* io)
+ (*standard-input* in)
+ (*terminal-io* io))
+ (funcall function))))
(defun read-from-emacs ()
"Read and process a request from Emacs."
More information about the slime-cvs
mailing list