[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Org Babel resolution of `:var` value reference inconsistent
From: |
Andreas Leha |
Subject: |
Re: [O] Org Babel resolution of `:var` value reference inconsistent |
Date: |
Wed, 04 Nov 2015 12:14:02 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (darwin) |
Hi Nick,
Nick Dokos <address@hidden> writes:
> Andreas Leha <address@hidden> writes:
>
>> ...
>> So, to me it is more surprising that the manual execution works. For
>> instance, I might have two tables with the same name. Then, COMMENTing
>> one of them should ensure that the other one is used.
>>
>
> COMMENT works during export *only* I believe. You have to explicitly
> comment out one of the tables otherwise. If there are two tables with
> the same name, babel will use the one nearer the beginning of the file
> and ignore the second one (I determined this experimentally, *not* by
> reading and understanding the code - ymmv).
Thanks for following up on this. I also ran some tests now and confirm
what you see. Test code below [2].
I'd say it is a bug if the results from evaluation differ between
manual evaluation and during export.
And even if it is not explicitely contradicting the manual [1] (which
does not say anything about finding references), I'd prefer if
references in COMMENT'ed sections are not found -- neither during export
nor during evaluation. This would be more inline with my intuition of
COMMENT is equivalent to # (which is also suggested by the fact that
COMMENT is described in the section on #).
Regards,
Andreas
[1] http://orgmode.org/manual/Comment-lines.html#Comment-lines
[2] Test code
--8<---------------cut here---------------start------------->8---
* Test COMMENTing babel reference
** COMMENT Table 1
#+name: testtable
| a | b |
|---+---|
| 1 | 2 |
# ** Table 2
# #+name: testtable
# | c | d |
# |---+---|
# | 3 | 4 |
# ** Table 2.5
# #+name: testtable2
# | c | d |
# |---+---|
# | 3 | 4 |
** Table 3
#+name: testtable
| e | f |
|---+---|
| 5 | 6 |
** Use (one of) the visible tables
This gives different results during export compared to manual
evaluation.
#+begin_src R :var tab=testtable :colnames yes :exports results
tab
#+end_src
#+results:
| a | b |
|---+---|
| 1 | 2 |
** Use the #'ed table :noexport:
This works neither during export nor during manual evaluation.
#+begin_src R :var tab=testtable2 :colnames yes :exports results
tab
#+end_src
--8<---------------cut here---------------end--------------->8---