emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] emacs-lisp babel won't print


From: John Kitchin
Subject: Re: [O] emacs-lisp babel won't print
Date: Fri, 25 Sep 2015 12:32:25 -0400
User-agent: mu4e 0.9.13; emacs 25.0.50.1

try:

#+BEGIN_SRC emacs-lisp :results output
(print-elements-of-list animals)
#+END_SRC

the default results are value, and your function does not return
anything I think. It prints them to output.

Lawrence Bottorff writes:

> If I do this:
>
> #+BEGIN_SRC emacs-lisp
> (setq animals '(gazelle giraffe lion tiger))
> #+END_SRC
>
> #+RESULTS:
> | gazelle | giraffe | lion | tiger |
>
> and then this
>
> #+begin_src emacs-lisp
> (defun print-elements-of-list (list)
>   "Print each element of LIST on a line of its own."
>   (while list
>     (print (car list))
>     (setq list (cdr list))))
> #+end_src
>
> #+RESULTS:
> : print-elements-of-list
>
> and finally
>
> #+BEGIN_SRC emacs-lisp
> (print-elements-of-list animals)
> #+END_SRC
>
> I get nothing for results and "Code block produced no output." in Messages.
> Why can't it print out? Same code works fine in the IELM buffer.
>
> LB

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]