From: Artem Baguinski
Subject: CMUCL alien + slime: can i see alien's stdout?
Date: 
Message-ID: <871xoikfjw.fsf@caracolito.lan>
i have a c function that printf()s and a lisp function that calls it
via CMUCL's alien. if i call it in a terminal i see what C function
prints, if i call the same fuctnion from slime REPL i can't find
where the alien stdout goes to. where is it?

-- 
gr{oe|ee}t{en|ings}
artm 

From: Helmut Eller
Subject: Re: CMUCL alien + slime: can i see alien's stdout?
Date: 
Message-ID: <m2r7wialj5.fsf@62.178.77.205>
Artem Baguinski <····@v2.nl> writes:

> i have a c function that printf()s and a lisp function that calls it
> via CMUCL's alien. if i call it in a terminal i see what C function
> prints, if i call the same fuctnion from slime REPL i can't find
> where the alien stdout goes to. where is it?

It is probably in the *inferior-lisp* buffer.  SLIME redirects CMUCL's
output to an Emacs buffer by rebinding *standard-output*.  printf is
independent of *standard-output* and so printf's output is not
redirected. 

Add this snippet to your .emacs if you like to see the *inferior-lisp*
buffer, whenever some output arrives there:

(add-hook 'inferior-lisp-mode-hook 
	  (defun my-inferior-lisp-mode-hook ()
            (add-to-list
             (make-local-variable 'comint-output-filter-functions)
             (lambda (string)
               (unless (get-buffer-window (current-buffer) t)
                 (display-buffer (current-buffer) t))
               (comint-postoutput-scroll-to-bottom string)))))


Helmut.
From: Artem Baguinski
Subject: Re: CMUCL alien + slime: can i see alien's stdout?
Date: 
Message-ID: <878yiqqkd8.fsf@caracolito.lan>
Helmut Eller <········@stud3.tuwien.ac.at> writes:

> Artem Baguinski <····@v2.nl> writes:
>
>> i have a c function that printf()s and a lisp function that calls it
>> via CMUCL's alien. if i call it in a terminal i see what C function
>> prints, if i call the same fuctnion from slime REPL i can't find
>> where the alien stdout goes to. where is it?
>
> It is probably in the *inferior-lisp* buffer.  SLIME redirects CMUCL's
> output to an Emacs buffer by rebinding *standard-output*.  printf is
> independent of *standard-output* and so printf's output is not
> redirected. 

yep, it's there, thanks!

> Add this snippet to your .emacs if you like to see the *inferior-lisp*
> buffer, whenever some output arrives there:
>
> (add-hook 'inferior-lisp-mode-hook 
> 	  (defun my-inferior-lisp-mode-hook ()
>             (add-to-list
>              (make-local-variable 'comint-output-filter-functions)
>              (lambda (string)
>                (unless (get-buffer-window (current-buffer) t)
>                  (display-buffer (current-buffer) t))
>                (comint-postoutput-scroll-to-bottom string)))))

wow, thanks again ;-)

-- 
gr{oe|ee}t{en|ings}
artm 
From: John Thingstad
Subject: Re: CMUCL alien + slime: can i see alien's stdout?
Date: 
Message-ID: <opr3x3n8irxfnb1n@news.chello.no>
On Wed, 25 Feb 2004 22:36:03 +0100, Artem Baguinski <····@v2.nl> wrote:

>
> i have a c function that printf()s and a lisp function that calls it
> via CMUCL's alien. if i call it in a terminal i see what C function
> prints, if i call the same fuctnion from slime REPL i can't find
> where the alien stdout goes to. where is it?
>

I'm not a expert on cmucl but slime connects to emacs via a socket.
That means it redirects the streams.
Try using fprintf instead and pass the *standard-output* handle.

-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/