emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: Benjamin Andresen <benny@in-ulm.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: [babel] allow emacs-lisp results to be pretty-printed
Date: Sun, 18 Oct 2009 10:12:39 -0600	[thread overview]
Message-ID: <m2pr8kllzc.fsf_-_@gmail.com> (raw)
In-Reply-To: <m2iqevi24b.fsf@gmail.com> (Eric Schulte's message of "Sun, 04 Oct 2009 09:56:52 -0600")

"Eric Schulte" <schulte.eric@gmail.com> writes:

>>> WRT the pp patch for emacs-lisp, I think it is an excellent addition and
>>> in fact I think that it points to a more general need.  Languages should
>>> have the option of returning values as they would appear when written in
>>> the language.  That is how they would be printed in a source-code file.
>>> This seems to be what your pp patch does for emacs-lisp.  In fact such
>>> output should be wrapped in a #+begin/end-src block for fontification of
>>> the results on export.

This is now implemented behind the "code" header argument.  The
following now works with the most recent version of Org-mode.  The
"code" header argument currently has explicit support in emacs-lisp,
ruby, and python.

Best -- Eric

#+begin_src emacs-lisp :results code
  (mapcar (lambda (el) (lambda (item) (+ item el))) '(1 2 3 4 5))

#+BEGIN_SRC emacs-lisp
   (+ item el))
   (+ item el))
   (+ item el))
   (+ item el))
   (+ item el)))

#+begin_src ruby :results code
  [1, 2, 33, 4].map{|n| "the number #{n}"}

#+BEGIN_SRC ruby
  ["the number 1", "the number 2", "the number 33", "the number 4"]

      parent reply	other threads:[~2009-10-18 16:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-03 18:29 org-babel: [PATCH] allow emacs-lisp results to be pretty-printed Benjamin Andresen
2009-10-03 19:27 ` Benjamin Andresen
     [not found]   ` <m2tyyfi3oz.fsf@gmail.com>
     [not found]     ` <87hbufqi8m.fsf@in-ulm.de>
     [not found]       ` <m2iqevi24b.fsf@gmail.com>
2009-10-18 16:12         ` 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:

  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=m2pr8kllzc.fsf_-_@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=benny@in-ulm.de \
    --cc=emacs-orgmode@gnu.org \


* 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


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).