From: Kaelin Colclasure
Subject: Output to emacs pop-up buffers
Date: 
Message-ID: <q7673lp27u.fsf@himalia.talarian.com>
I am experimenting with creating an interactive simulation in ACL. The
simulation has several CLOS objects which generate printed output when they
"execute". I'd *really* like to be able to direct their output to a separate
buffer window in emacs, much like the Lisp compiler's diagnostics. Is there
a simple way to do this?

I am using ACL 5.0 and GNU emacs 19.34 on Windows NT (if that makes a
difference).

From: Pierre R. Mai
Subject: Re: Output to emacs pop-up buffers
Date: 
Message-ID: <87aeswh7c7.fsf@orion.dent.isdn.cs.tu-berlin.de>
Kaelin Colclasure <······@himalia.talarian.com> writes:

> I am experimenting with creating an interactive simulation in ACL. The
> simulation has several CLOS objects which generate printed output when they
> "execute". I'd *really* like to be able to direct their output to a separate
> buffer window in emacs, much like the Lisp compiler's diagnostics. Is there
> a simple way to do this?
> 
> I am using ACL 5.0 and GNU emacs 19.34 on Windows NT (if that makes a
> difference).

I'd think that Erik Naggum might have a good idea how to do this with
GNU Emacs and ACL, since I believe he uses GNU Emacs as (part of?) a
user interface.  Since I find this a very interesting idea, I wouldn't
mind hearing more about this, myself.  Sadly, Erik seems to have been
busy doing other things in the past weeks, seeing the absence of any
postings from him (but one)...

Other than that, I believe that there is quite good documentation
available for ELI (Franz's Emacs Lisp Interface), which will probably
contain information on doing this...

Regs, Pierre.

-- 
Pierre Mai <····@acm.org>         PGP and GPG keys at your nearest Keyserver
  "One smaller motivation which, in part, stems from altruism is Microsoft-
   bashing." [Microsoft memo, see http://www.opensource.org/halloween1.html]
From: R. Matthew Emerson
Subject: Re: Output to emacs pop-up buffers
Date: 
Message-ID: <87pv1sikfh.fsf@nightfly.apk.net>
····@acm.org (Pierre R. Mai) writes:

> Kaelin Colclasure <······@himalia.talarian.com> writes:
> 
> > I'd *really* like to be able to direct their output to a separate
> > buffer window in emacs, much like the Lisp compiler's diagnostics. Is there
> > a simple way to do this?
> > 
> > I am using ACL 5.0 and GNU emacs 19.34 on Windows NT (if that makes a
> > difference).
> 
> Other than that, I believe that there is quite good documentation
> available for ELI (Franz's Emacs Lisp Interface), which will probably
> contain information on doing this...

Maybe this is what you want?  This works on my FreeBSD box using
GNU Emacs 20.3 and ACL 5.0.1.

(with-open-stream (*query-io*
			     (lep:make-editor-listener-stream :name "foo"))
	    (format *query-io* "Is today Wednesday? ")
	    (stream-finish-output *query-io*)
	    (y-or-n-p))

This will create an Emacs buffer called "foo", display the question,
and read the answer.  Adjust stream variable to taste. See the Franz
ACL FAQ (question 4.2-1).

-matt
From: David Bakhash
Subject: Re: Output to emacs pop-up buffers
Date: 
Message-ID: <cxjso6orzjf.fsf@acs5.bu.edu>
Untested, but this macro might be nicer to use:

(defmacro with-output-to-temp-buffer ((stream
				       &optional (name "*acl-temp*"))
				      &body body)
  `(with-open-stream
       (,stream (lep:make-editor-listener-stream :name ',name)
	,@body)))

dave
From: Steven M. Haflich
Subject: Re: Output to emacs pop-up buffers
Date: 
Message-ID: <3793B842.F4C26751@franz.com>
David Bakhash wrote:
> 
> Untested, but this macro might be nicer to use:
> 
> (defmacro with-output-to-temp-buffer ((stream
>                                        &optional (name "*acl-temp*"))
>                                       &body body)
>   `(with-open-stream
>        (,stream (lep:make-editor-listener-stream :name ',name)
>         ,@body)))

The right idea, but w-o-t-t-b is already defined by Emacs and you
shouldn't clobber that definition!
From: Kaelin Colclasure
Subject: Re: Output to emacs pop-up buffers
Date: 
Message-ID: <q74sj4oswk.fsf@himalia.talarian.com>
···@nightfly.apk.net (R. Matthew Emerson) writes:

> ····@acm.org (Pierre R. Mai) writes:
> 
> Maybe this is what you want?  This works on my FreeBSD box using
> GNU Emacs 20.3 and ACL 5.0.1.
> 
> (with-open-stream (*query-io*
> 			     (lep:make-editor-listener-stream :name "foo"))
> 	    (format *query-io* "Is today Wednesday? ")
> 	    (stream-finish-output *query-io*)
> 	    (y-or-n-p))
> 
> This will create an Emacs buffer called "foo", display the question,
> and read the answer.  Adjust stream variable to taste. See the Franz
> ACL FAQ (question 4.2-1).
> 
> -matt

Thanks for the suggestion -- and for the pointer to the FAQ!