Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!nbires!ico!cadnetix.UUCP!pem
From: pem@cadnetix.UUCP (Paul Meyer)
Newsgroups: comp.emacs
Subject: Re: emacs-lisp function-results - can it be sent to a buffer
Message-ID: <710@cadnetix.UUCP>
Date: Thu, 9-Jul-87 14:55:36 EDT
Article-I.D.: cadnetix.710
Posted: Thu Jul  9 14:55:36 1987
Date-Received: Sun, 12-Jul-87 10:04:59 EDT
References: <2190@hplabsc.UUCP>
Reply-To: pem@cadnetix.UUCP (Paul Meyer)
Organization: Cadnetix Corp., Boulder, CO
Lines: 36

[]
	I have succesfully used (with-output-to-temp-buffer) to send output
   to a buffer.  You also need to make your output come out to the lisp stdout
   to do this, using prin1/princ/whatever.  You can also create a buffer and
   pop up a window on it, then use (insert (prin1 (your-func))) or some such.

	Here are some examples that should work.  (Disclaimer--I don't have
   the time (company time) to test these):

   (defun bletch (buffername)
     "Write a string to BUFFER."
     (with-output-to-temp-buffer buffername (prin1 (+ 3 4))))
   
   (defun squat (buffername)
     "Pop up a buffer named BUFFER, and write to its end."
     (pop-to-buffer buffername)
     (save-excursion
	(goto-char (point-max))
	(insert (prin1-to-string (+ 3 4)))))

	Something I have found invaluable in lieu of a real elisp manual is
   to do M-x apropos "." then save the help buffer.  In my case,
   I dumped it to the laser printer.  I also did a command-apropos of "."
   and saved that one, then did a bunch of manipulation to get two files,
   one just the interactive commands (the straight command-apropos output)
   and one just the noninteractive ones (the apropos output not in the command-
   apropos output).  If I remember correctly, I used emacs or sed to put the
   one-line descriptions (when they existed) on the end of the name lines,
   merged the files using sort, used uniq to discard all repetitions of re-
   peated lines, then undid the joining.  When I see an interesting function
   for something I'm trying to do, I do help F to get the full description.
	Because I am working without an elisp manual, I have learned most
   things by trial and error and looking at the standard code, so I may be
   missing a much easier way to do this.

						pem@cadnetix.uucp