emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Ethan Ligon <ligon@are.berkeley.edu>
Cc: "Emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: [Babel][Bug] Inconsistent output from babel function depending on how called
Date: Thu, 26 May 2011 12:46:27 -0600	[thread overview]
Message-ID: <87wrhdqozg.fsf@gmail.com> (raw)
In-Reply-To: <BANLkTi=H9tasSwrPy6+JkSjeUz-J_DJtgw@mail.gmail.com> (Ethan Ligon's message of "Thu, 26 May 2011 11:37:33 -0700")

Ethan Ligon <ligon@are.berkeley.edu> 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/

  reply	other threads:[~2011-05-26 18:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-26 18:37 [Babel][Bug] Inconsistent output from babel function depending on how called Ethan Ligon
2011-05-26 18:46 ` Eric Schulte [this message]
2011-05-26 19:17   ` Christian Moe
2011-05-27  1:04     ` Ethan Ligon
2011-05-27 15:28       ` Eric Schulte
2011-05-27 16:35     ` Eric Schulte
2011-05-26 19:36   ` Ethan Ligon
2011-05-26 23:57     ` Eric Schulte

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  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=87wrhdqozg.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=ligon@are.berkeley.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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