From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: emacs-lisp babel won't print Date: Fri, 25 Sep 2015 12:32:25 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfVvD-0004Ny-1p for emacs-orgmode@gnu.org; Fri, 25 Sep 2015 12:32:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfVv9-0006l7-Hx for emacs-orgmode@gnu.org; Fri, 25 Sep 2015 12:32:30 -0400 Received: from mail-qg0-x235.google.com ([2607:f8b0:400d:c04::235]:33467) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfVv9-0006kv-F1 for emacs-orgmode@gnu.org; Fri, 25 Sep 2015 12:32:27 -0400 Received: by qgev79 with SMTP id v79so73423163qge.0 for ; Fri, 25 Sep 2015 09:32:26 -0700 (PDT) In-reply-to: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Lawrence Bottorff Cc: emacs-orgmode Mailinglist 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