* [babel] howto debug #+call lines
@ 2012-10-03 21:02 Andreas Leha
2012-10-05 2:39 ` Eric Schulte
0 siblings, 1 reply; 8+ messages in thread
From: Andreas Leha @ 2012-10-03 21:02 UTC (permalink / raw)
To: emacs-orgmode
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* [babel] howto debug #+call lines
@ 2012-10-03 21:07 Andreas Leha
0 siblings, 0 replies; 8+ messages in thread
From: Andreas Leha @ 2012-10-03 21:07 UTC (permalink / raw)
To: emacs-orgmode
Hi all,
(seems like I am having trouble to post -- sorry if multiple copies of
this end up on the list)
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [babel] howto debug #+call lines
2012-10-03 21:02 Andreas Leha
@ 2012-10-05 2:39 ` Eric Schulte
2012-10-05 21:06 ` Andreas Leha
0 siblings, 1 reply; 8+ messages in thread
From: Eric Schulte @ 2012-10-05 2:39 UTC (permalink / raw)
To: Andreas Leha; +Cc: emacs-orgmode
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
--
Eric Schulte
http://cs.unm.edu/~eschulte
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [babel] howto debug #+call lines
2012-10-05 2:39 ` Eric Schulte
@ 2012-10-05 21:06 ` Andreas Leha
2012-10-07 1:03 ` Eric Schulte
0 siblings, 1 reply; 8+ messages in thread
From: Andreas Leha @ 2012-10-05 21:06 UTC (permalink / raw)
To: emacs-orgmode
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?
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [babel] howto debug #+call lines
2012-10-05 21:06 ` Andreas Leha
@ 2012-10-07 1:03 ` Eric Schulte
2012-10-08 12:35 ` Andreas Leha
0 siblings, 1 reply; 8+ messages in thread
From: Eric Schulte @ 2012-10-07 1:03 UTC (permalink / raw)
To: Andreas Leha; +Cc: emacs-orgmode
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [babel] howto debug #+call lines
2012-10-07 1:03 ` Eric Schulte
@ 2012-10-08 12:35 ` Andreas Leha
2012-10-09 2:31 ` Eric Schulte
0 siblings, 1 reply; 8+ messages in thread
From: Andreas Leha @ 2012-10-08 12:35 UTC (permalink / raw)
To: emacs-orgmode
Hi Eric,
> 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.
>
>
>>
>> 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
>>
>>
Thanks for the confirmation, that there is no possibility to expand a
#+call line.
I know, that I can jump to the code block and expand that one (quite
fast with C-c C-v g RET C-c C-v v), but that is exactly *not* what I was
looking for. Because then, the header arguments to the source code
block will apply instead of the header arguments to the #+call line.
I was hoping for a C-c C-v v on #+call lines, which would spare me from
modifying the source block's header arguments. But it is not a pressing
issue, just my laziness (and bad coding perhaps).
Regards,
Andreas
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [babel] howto debug #+call lines
2012-10-08 12:35 ` Andreas Leha
@ 2012-10-09 2:31 ` Eric Schulte
2012-10-09 16:15 ` Andreas Leha
0 siblings, 1 reply; 8+ messages in thread
From: Eric Schulte @ 2012-10-09 2:31 UTC (permalink / raw)
To: Andreas Leha; +Cc: emacs-orgmode
Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
> Hi Eric,
>
>
>> 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.
>>
>>
>>>
>>> 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
>>>
>>>
>
> Thanks for the confirmation, that there is no possibility to expand a
> #+call line.
>
> I know, that I can jump to the code block and expand that one (quite
> fast with C-c C-v g RET C-c C-v v), but that is exactly *not* what I was
> looking for. Because then, the header arguments to the source code
> block will apply instead of the header arguments to the #+call line.
>
> I was hoping for a C-c C-v v on #+call lines, which would spare me from
> modifying the source block's header arguments. But it is not a pressing
> issue, just my laziness (and bad coding perhaps).
>
Patches are always welcome. :)
The call line is evaluated by first expanding itself into a full code
block, so perhaps you could add functionality to C-c C-v v so that it
will expand this ephemeral code block. Additionally it may be easy to
update C-c C-v I so that it works on call lines, which may provide the
information you're after.
Best,
>
> Regards,
> Andreas
>
>
>
--
Eric Schulte
http://cs.unm.edu/~eschulte
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [babel] howto debug #+call lines
2012-10-09 2:31 ` Eric Schulte
@ 2012-10-09 16:15 ` Andreas Leha
0 siblings, 0 replies; 8+ messages in thread
From: Andreas Leha @ 2012-10-09 16:15 UTC (permalink / raw)
To: emacs-orgmode
Eric Schulte <eric.schulte@gmx.com> writes:
> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>
>> Hi Eric,
>>
>>
>>> 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.
>>>
>>>
>>>>
>>>> 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
>>>>
>>>>
>>
>> Thanks for the confirmation, that there is no possibility to expand a
>> #+call line.
>>
>> I know, that I can jump to the code block and expand that one (quite
>> fast with C-c C-v g RET C-c C-v v), but that is exactly *not* what I was
>> looking for. Because then, the header arguments to the source code
>> block will apply instead of the header arguments to the #+call line.
>>
>> I was hoping for a C-c C-v v on #+call lines, which would spare me from
>> modifying the source block's header arguments. But it is not a pressing
>> issue, just my laziness (and bad coding perhaps).
>>
>
> Patches are always welcome. :)
That's plagiarism. You should cite Bastien here :)
>
> The call line is evaluated by first expanding itself into a full code
> block, so perhaps you could add functionality to C-c C-v v so that it
> will expand this ephemeral code block. Additionally it may be easy to
> update C-c C-v I so that it works on call lines, which may provide the
> information you're after.
Thanks for the pointers. Let's see whether I'll find time. Should not
be hard even with my elisp "skills".
Regards,
Andreas
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-10-09 16:16 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-03 21:07 [babel] howto debug #+call lines Andreas Leha
-- strict thread matches above, loose matches on Subject: below --
2012-10-03 21:02 Andreas Leha
2012-10-05 2:39 ` Eric Schulte
2012-10-05 21:06 ` Andreas Leha
2012-10-07 1:03 ` Eric Schulte
2012-10-08 12:35 ` Andreas Leha
2012-10-09 2:31 ` Eric Schulte
2012-10-09 16:15 ` Andreas Leha
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).