From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [Babel][Bug] Inconsistent output from babel function depending on how called Date: Thu, 26 May 2011 12:46:27 -0600 Message-ID: <87wrhdqozg.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:58904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPfZo-00051U-VZ for emacs-orgmode@gnu.org; Thu, 26 May 2011 14:46:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QPfZn-0006dU-RH for emacs-orgmode@gnu.org; Thu, 26 May 2011 14:46:32 -0400 Received: from mail-pz0-f41.google.com ([209.85.210.41]:39087) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPfZn-0006dK-MA for emacs-orgmode@gnu.org; Thu, 26 May 2011 14:46:31 -0400 Received: by pzk4 with SMTP id 4so530652pzk.0 for ; Thu, 26 May 2011 11:46:30 -0700 (PDT) In-Reply-To: (Ethan Ligon's message of "Thu, 26 May 2011 11:37:33 -0700") 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: Ethan Ligon Cc: "Emacs-orgmode@gnu.org" Ethan Ligon writes: > I'd like to call a simple babel code block to generate org-code > If I define a list thusly: > > #+results: list1 > - foo > - bar > > Then I define a code block thusly, and execute it by C-c C-c on the > "source" line. That yields the desired result: a sequence of headings > under "#+results: print_list". > > #+source: print_list(lst=list1) > #+begin_src sh :results output org > for i in $lst; do > echo "* $i" > done > #+end_src > > #+results: print_list > #+BEGIN_ORG > * foo > * bar > #+END_ORG > > Now I want to reuse the code block to generate other sequences of > headings. But even if I call it with the *same* list, instead of the > desired headings, I get a literal, as below. > > #+call: print_list(lst=list1) > > #+results: print_list(lst=list1) > : * foo > : * bar > > I think this qualifies as a bug---surely the method of calling the > code block shouldn't affect the output? > No, this is expected (if possibly under-documented behavior). The :results header arguments are associated with the code block and *not* with the #+call line. To get the desired behavior, you must specify the :results header argument on the #+call: line thusly. #+call: print_list(lst=list1) :results output org Best -- Eric > > Thoughts, patches, or work-arounds welcomed! > > Thanks, > -Ethan -- Eric Schulte http://cs.unm.edu/~eschulte/