emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: Matthew Oesting <oestingm@me.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: Emacs-orgmode Digest, Vol 62, Issue 11
Date: Sun, 10 Apr 2011 16:45:37 -0600	[thread overview]
Message-ID: <87hba5pvxq.fsf@gmail.com> (raw)
In-Reply-To: <80402BB7-A2EC-4530-8EF1-442E775D6D46@me.com> (Matthew Oesting's message of "Sun, 10 Apr 2011 17:54:25 -0400")

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 <oestingm@me.com> 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/

      reply	other threads:[~2011-04-10 22:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0LJG00AQ51TP5FC0@smtpin127.mac.com>
2011-04-10 21:54 ` Emacs-orgmode Digest, Vol 62, Issue 11 Matthew Oesting
2011-04-10 22:45   ` Eric Schulte [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87hba5pvxq.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=oestingm@me.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).