[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: *standard-output*



>I would like to describe an object (with the describe function). Not in the
>listener but in a new fred window. After haing created a new instance of
>fred-window, I would like to redirect the output to this window.
>
>So I do the following :
>
>;; save the current output
>(defvar oldIO *standard-output*)
>
>;; change to the new output. New should be a fred-window
>(defun changeIO (new)
>    (setq *standard-output* new)
>)
>
>;; restore the output to the standard one
>(defun restoreIO ()
>    (setq *standard-ouput* oldIO)
>)
>
>All """seems""" to work except restoreIO. When compiling I have a warning
>about undeclared free variable *standard-output* (only in restoreIO). After
>using restoreIO, the output is still my fred-window (by behavior). But when
>I check the value of *standard-output* it is the right one (terminal-IO
>something, the listener I suppose).
>Moreover if, in the listener, I ask "(setq *standard-output* oldIO)", it
>works and the behavior is the expected one : the new IO is the listener.
>
>Where am I wrong ????
>
>Mathieu
>---
>Lafourcade Mathieu
>GETA (Groupe d'Etude pour la Traduction Automatique)
>BP 53X, 38041 GRENOBLE CEDEX, FRANCE
>
>Lafourca@imag.fr

At a first looked, I didnt see what was wrong, but when I actually
tried your example and got the same warning, I saw the problem:
a simple typing mistake!

  (defun restoreIO ()
    (setq *standard-ouput* oldIO)     ; ouput should be output

BTW: Did you know that fred windows where output stream?
     To write into a fred window, all you have to do is
     (FORMAT my-fred-window-instance "Hello everyone")
     or use any of your favorite output functions...

Guillaume Cartier
LACIM, Universite du Quebec a Montreal.
Bureau: (514) 987-4290
E-Mail: cartier@math.uqam.ca