From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Re: Emacs-orgmode Digest, Vol 62, Issue 11 Date: Sun, 10 Apr 2011 16:45:37 -0600 Message-ID: <87hba5pvxq.fsf@gmail.com> References: <0LJG00AQ51TP5FC0@smtpin127.mac.com> <80402BB7-A2EC-4530-8EF1-442E775D6D46@me.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=48980 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q93O7-0008IK-3P for emacs-orgmode@gnu.org; Sun, 10 Apr 2011 18:45:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q93O5-0000Y9-Fh for emacs-orgmode@gnu.org; Sun, 10 Apr 2011 18:45:46 -0400 Received: from mail-iy0-f169.google.com ([209.85.210.169]:60864) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q93O5-0000Xq-Bo for emacs-orgmode@gnu.org; Sun, 10 Apr 2011 18:45:45 -0400 Received: by iyf13 with SMTP id 13so6826074iyf.0 for ; Sun, 10 Apr 2011 15:45:44 -0700 (PDT) In-Reply-To: <80402BB7-A2EC-4530-8EF1-442E775D6D46@me.com> (Matthew Oesting's message of "Sun, 10 Apr 2011 17:54:25 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Matthew Oesting Cc: emacs-orgmode@gnu.org Hi Matthew, You're not missing anything obvious, there are two points which are keeping this from succeeding. First, emacs-lisp did not support the ":results output", however I've just pushed up a patch which adds this support to emacs-lisp code blocks. Second, you have ":export output" below, when you should have ":results output", and if you do want to change export options the header argument is ":exports" (plural) not ":export". I really need to implement some sort of highlighting to catch these small header-argument errors as they're extremely common. With the latest Org-mode the following should work. #+begin_src emacs-lisp :results output (let ((dog (sqrt 2)) (cat 7)) (print (format "%s %f" "Dog: " (eval dog))) (print (format "%s %d" "Cat: " (eval cat)) nil) (print "Fish.")) #+end_src #+results: : : "Dog: 1.414214" : : "Cat: 7" : : "Fish." Although I'd recommend returning the value as a list #+begin_src emacs-lisp (let ((dog (sqrt 2)) (cat 7)) `((dog ,dog) (cat ,cat) (fish))) #+end_src #+results: | dog | 1.4142135623730951 | | cat | 7 | | fish | | Cheers -- Eric Matthew Oesting writes: > I am sure that this is a trivially simple issue that I've simply overlooked in the manual, but by God, I've been studiously overlooking it for about an hour... > > I simply print a few things... > > #+BEGIN_SRC emacs-lisp :export output > > (let ( > (dog (sqrt 2)) > (cat 7) > ) > > (print (format "%s %f" "Dog: " (eval dog))) > (print (format "%s %d" "Cat: " (eval cat)) nil) > (print "Fish.") > ) > > #+END_SRC > > #+results: > : Fish. > > Only the last value ever survives the printing process. One line > attempts to print to standard out without specification, and the other > names the stream specifically, but in all cases, only the last message > ever seems to survive. It is as if all messages are directed to the > minibuffer, happily clobbering previous output like a sequence of baby > seals, and then that minibuffer is reported as the output stream. > > Is there some way to allow for all printed output to survive? > > - M > > -- Eric Schulte http://cs.unm.edu/~eschulte/