"Eric Schulte" <schulte.e...@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))
#+end_src

#+resname:
#+BEGIN_SRC emacs-lisp
((lambda
   (item)
   (+ item el))
 (lambda
   (item)
   (+ item el))
 (lambda
   (item)
   (+ item el))
 (lambda
   (item)
   (+ item el))
 (lambda
   (item)
   (+ item el)))
#+END_SRC

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

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


_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to