Good day folks,
The following patch fixes the *standard-output* not being redirected into the *slime-repl* buffer on SBCL/win32 specifically, and in all cases when connection communication style is NIL, in general.
The problem appeared in the CVS commit dated 2008-12-24 11:14:06, which moved environment capture past the point where the event handlers were entering the binding of the stream variables, which is set from the environment.
The fix was tested on Linux/x86/SBCL-1.0.22 and MinGW/SBCL-1.0.28.43.
commit 87cd4f6167e0b9695a279d8c64e1f4876a001e0a Author: Samium Gromoff _deepfire@feelingofgreen.ru Date: Wed May 13 23:44:52 2009 +0400
Capture stream globals before the request servers are called.
diff --git a/swank.lisp b/swank.lisp index a0646c2..90418f2 100644 --- a/swank.lisp +++ b/swank.lisp @@ -1408,6 +1408,16 @@ The processing is done in the extent of the toplevel restart." :serve-requests #'simple-serve-requests)) ))) (setf (connection.communication-style c) style) + (initialize-streams-for-connection c) + (with-struct* (connection. @ c) + (setf (@ env) + `((*standard-output* . ,(@ user-output)) + (*standard-input* . ,(@ user-input)) + (*trace-output* . ,(or (@ trace-output) (@ user-output))) + (*error-output* . ,(@ user-output)) + (*debug-io* . ,(@ user-io)) + (*query-io* . ,(@ user-io)) + (*terminal-io* . ,(@ user-io))))) (setf success t) c) (unless success @@ -1569,16 +1579,7 @@ NIL if streams are not globally redirected.") (defslimefun create-repl (target) (assert (eq target nil)) (let ((conn *emacs-connection*)) - (initialize-streams-for-connection conn) (with-struct* (connection. @ conn) - (setf (@ env) - `((*standard-output* . ,(@ user-output)) - (*standard-input* . ,(@ user-input)) - (*trace-output* . ,(or (@ trace-output) (@ user-output))) - (*error-output* . ,(@ user-output)) - (*debug-io* . ,(@ user-io)) - (*query-io* . ,(@ user-io)) - (*terminal-io* . ,(@ user-io)))) (maybe-redirect-global-io conn) (when (use-threads-p) (setf (@ repl-thread) (spawn-repl-thread conn "repl-thread")))
regards, Samium Gromoff
On Thu, 14 May 2009 00:45:01 +0400 (MSD), Samium Gromoff _deepfire@feelingofgreen.ru wrote:
Good day folks,
The following patch fixes the *standard-output* not being redirected into the *slime-repl* buffer on SBCL/win32 specifically, and in all cases when connection communication style is NIL, in general.
The problem appeared in the CVS commit dated 2008-12-24 11:14:06, which moved environment capture past the point where the event handlers were entering the binding of the stream variables, which is set from the environment.
The fix was tested on Linux/x86/SBCL-1.0.22 and MinGW/SBCL-1.0.28.43.
commit 87cd4f6167e0b9695a279d8c64e1f4876a001e0a Author: Samium Gromoff _deepfire@feelingofgreen.ru Date: Wed May 13 23:44:52 2009 +0400
Capture stream globals before the request servers are called.
diff --git a/swank.lisp b/swank.lisp index a0646c2..90418f2 100644 --- a/swank.lisp +++ b/swank.lisp @@ -1408,6 +1408,16 @@ The processing is done in the extent of the toplevel restart." :serve-requests #'simple-serve-requests)) ))) (setf (connection.communication-style c) style)
(initialize-streams-for-connection c)
(with-struct* (connection. @ c)
(setf (@ env)
`((*standard-output* . ,(@ user-output))
(*standard-input* . ,(@ user-input))
(*trace-output* . ,(or (@ trace-output) (@ user-output)))
(*error-output* . ,(@ user-output))
(*debug-io* . ,(@ user-io))
(*query-io* . ,(@ user-io))
(*terminal-io* . ,(@ user-io))))) (setf success t) c) (unless success
@@ -1569,16 +1579,7 @@ NIL if streams are not globally redirected.") (defslimefun create-repl (target) (assert (eq target nil)) (let ((conn *emacs-connection*))
- (initialize-streams-for-connection conn) (with-struct* (connection. @ conn)
(setf (@ env)
`((*standard-output* . ,(@ user-output))
(*standard-input* . ,(@ user-input))
(*trace-output* . ,(or (@ trace-output) (@ user-output)))
(*error-output* . ,(@ user-output))
(*debug-io* . ,(@ user-io))
(*query-io* . ,(@ user-io))
(*terminal-io* . ,(@ user-io)))) (maybe-redirect-global-io conn) (when (use-threads-p) (setf (@ repl-thread) (spawn-repl-thread conn "repl-thread")))
When I applied this patch to the SLIME CVS update that I had downloaded on May 20, 2009, at 05:42, for Windows XP Professional, Service Pack 2, slime-banner failed to be invoked, and the following messages appeared in my REPL at started:
CL-USER> ;; Loading file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-asdf.fas ... ;; Loaded file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-asdf.fas ;; Loading file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-package-fu.fas ... ;; Loaded file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-package-fu.fas ;; Loading file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-fuzzy.fas ... ;; Loading file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-c-p-c.fas ... ;; Loaded file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-c-p-c.fas ;; Loaded file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-fuzzy.fas ;; Loading file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-fancy-inspector.fas ... ;; Loaded file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-fancy-inspector.fas ;; Loading file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-arglists.fas ... ;; Loaded file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-arglists.fas ;; Loading file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-presentations.fas ... ;; Loaded file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-presentations.fas CL-USER> CL-USER>
Anybody know how to patch this patch? Apparently, this patch does not seem to have been applied in the CVS version of swank.lisp downloadable from http://common-lisp.net/project/slime/snapshots/slime-current.tgz.
Just for reference, here are relevant lines from my .emacs file:
;; Setup for SLIME (setq inferior-lisp-program "C:/bin/clisp-2.45/full/lisp.exe -B C:/bin/clisp-2.45/full -M C:/bin/clisp-2.45/full/lispinit.mem -ansi -q") (add-to-list 'load-path "C:/bin/emacs/site-lisp/slime/") (require 'slime) (slime-setup '(slime-fancy slime-asdf slime-banner))
-- Benjamin L. Russell