[ltk-user] fix for ltk on mswin?

dherring at tentpost.com dherring at tentpost.com
Sat Feb 20 05:34:34 UTC 2010


Daniel wrote:
> Still poking around.

Doh!  I found my problem.  Either commenting out

#fconfigure stdin -encoding utf-8 -translation ~a
#fconfigure stdout -encoding utf-8

or enabling (setf translation "crlf") fixes all my problems.  Why I didn't
see this earlier?  Why did I let the :lispworks scare me away?

The Ltk examples and ABLE both work fine now.

A major benefit of the (sleep 1) was to let Tk appear before Ltk sent it
bad commands.  However, it should not be removed; I still need it for
proper operation under clisp.

By my understanding, SBCL is the only lisp that doesn't translate ~% as
\r\n on MS platforms.  Thus every other CL on windows should get the crlf
translation.

Here are my recommended patches to the current repl/ltk.lisp.  With them,
Ltk::ltktest and ABLE::start ran properly under both clozure-1.4 and
clisp-2.48.  Note that Clozure puts :windows on *features*, and Clisp uses
:win32.


@@ -681,7 +681,7 @@ proc moveToStart {sb} {

 (defun init-tcl (&key debug-tcl)
   (let ((translation "lf"))
-    #+(and :lispworks :windows) (setf translation "crlf")
+    #+(and (or windows win32) (not sbcl)) (setf translation "crlf")

     (format (wish-stream *wish*) "set buffer \"\"
 set server stdout
@@ -764,7 +764,7 @@ fconfigure stdout -encoding utf-8
   (if (null (wish-stream *wish*))
       (progn
         (setf (wish-stream *wish*) (or stream (do-execute *wish-pathname*
*wish-args*)))
-        #+mswindows (sleep 1)
+        #+(or windows win32) (sleep 1)
         (setf (wish-call-with-condition-handlers-function *wish*)
 	      (make-call-with-condition-handlers-function debugger-class))
 	;; perform tcl initialisations


Later,
Daniel





More information about the ltk-user mailing list