emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <eric.schulte@gmx.com>
To: Andreas Leha <andreas.leha@med.uni-goettingen.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: [babel] howto debug #+call lines
Date: Sat, 06 Oct 2012 19:03:03 -0600	[thread overview]
Message-ID: <87obkf14c8.fsf@gmx.com> (raw)
In-Reply-To: <87k3v4tyqk.fsf@med.uni-goettingen.de> (Andreas Leha's message of "Fri, 05 Oct 2012 23:06:43 +0200")

Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:

> Hi Eric,
>
>> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>>
>>> Hi all,
>>>
>>> I am getting different results from the evaluation of a source block and
>>> the evaluation of a #+call line to that block.
>>>
>>> Therefore, my question: Is there an equivalent to
>>> org-babel-expand-src-block (C-c C-v v) for #+call lines?
>>>
>>> Or more general:  How do I debug #+call lines?
>>>
>>> Regards,
>>> Andreas
>>>
>>
>> Can you provide a minimal example?
>>
>> You could write a code block equivalent to the call line.  E.g.,
>>
>>     #+call: foo(bar=1)
>>
>> is equivalent to
>>
>>     #+begin_src emacs-lisp :var results=foo(bar=1)
>>       results
>>     #+end_src
>
> Thanks for following this up.  I found the problem in my case:  The
> header argument ':colnames yes' was missing from the call line, such that
> the passed variables were different.  (I've fallen into that trap
> repeatedly, but do not learn, as it seems...)
>
> It would have been a lot easier to find this, if I had had the possibility
> to do C-c C-v v on the call line to get the chance to step through the
> (R-) code that is evaluated.  Without this, it took me some time to
> figure things out.
>
> So the question still stands: Is there the possibility to see what is
> actually executed with a call line, similar to C-c C-v v on a source
> block?
>

There is no body to expand in a call line so C-c C-v v would have
nothing to show.  You can however jump to the related code block and
call C-c C-v v there.  This process could be made faster by wrapping the
org-babel-goto-named-src-block and org-babel-expand-src-block functions
into a single function.

Best,

>
> For a small example consider:
>
> ---
> #+name: foo
> | bar |
> | baz |
> | bam |
>
> #+call: testblock[:var a=foo]() :colnames yes
>
> #+name: testblock
> #+begin_src R :var a=foo :colnames yes
>   a <- a[,1]
>   data.frame(x=a)
> #+end_src
> ---
>
> Regards,
> Andreas
>
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

  reply	other threads:[~2012-10-07  1:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-03 21:02 [babel] howto debug #+call lines Andreas Leha
2012-10-05  2:39 ` Eric Schulte
2012-10-05 21:06   ` Andreas Leha
2012-10-07  1:03     ` Eric Schulte [this message]
2012-10-08 12:35       ` Andreas Leha
2012-10-09  2:31         ` Eric Schulte
2012-10-09 16:15           ` Andreas Leha
  -- strict thread matches above, loose matches on Subject: below --
2012-10-03 21:07 Andreas Leha

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=87obkf14c8.fsf@gmx.com \
    --to=eric.schulte@gmx.com \
    --cc=andreas.leha@med.uni-goettingen.de \
    --cc=emacs-orgmode@gnu.org \
    /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).