logo       

Re: RFE: debugging in separate window: msg#00098

lisp.clisp.general

Subject: Re: RFE: debugging in separate window

Here is the final version:

(defun make-xterm-io ()
(let* ((pipe (with-open-stream (s (make-pipe-input-stream
"mktemp /tmp/clisp-x-io-XXXXXX"))
(read-line s)))
(title "CLISP query IO")
tty-name xio
(clos::*warn-if-gf-already-called* nil))
(shell (format nil "rm -f ~a; mknod ~a p; ~
xterm -n ~s -T ~s -e 'tty >> ~a; cat ~a' &"
pipe pipe title title pipe pipe))
(setq tty-name
(with-open-file (s pipe :direction :input) (read-line s))
xio (make-two-way-stream
(open tty-name :direction :input)
(open tty-name :direction :output)))
(defmethod close :after ((x (eql xio)) &rest junk)
(declare (ignore x junk))
(with-open-file (s pipe :direction :output)
(format s "goodbye!~%"))
(delete-file pipe)
(close (two-way-stream-input-stream xio))
(close (two-way-stream-output-stream xio))
(let ((clos::*warn-if-gf-already-called* nil))
(remove-method #'close (find-method #'close '(:after) `((eql ,xio))))))
xio))

(with-open-stream (*query-io* (make-xterm-io)) (y-or-n-p "foo?"))

please try it.


--
Sam Steingold (http://www.podval.org/~sds) running RedHat8 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
cogito cogito ergo cogito sum



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise