Hi Nick, Nick Dokos <ndo...@gmail.com> writes: > Andreas Leha <andreas.l...@med.uni-goettingen.de> 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---