emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Andreas Leha <andreas.leha@med.uni-goettingen.de>
To: emacs-orgmode@gnu.org
Subject: Re: Org Babel resolution of `:var` value reference inconsistent
Date: Wed, 04 Nov 2015 12:14:02 +0000	[thread overview]
Message-ID: <oluoafam06t.fsf@med.uni-goettingen.de> (raw)
In-Reply-To: 874mh48roq.fsf@pierrot.dokosmarshall.org

Hi Nick,

Nick Dokos <ndokos@gmail.com> writes:
> Andreas Leha <andreas.leha@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---

  reply	other threads:[~2015-11-04 12:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-02  7:40 Org Babel resolution of `:var` value reference inconsistent myq
2015-11-02  9:01 ` Andreas Leha
2015-11-02 13:19   ` Nick Dokos
2015-11-04 12:14     ` Andreas Leha [this message]
2015-11-05 12:56       ` Martin Carlé
2015-11-05 14:48         ` Nicolas Goaziou
2015-11-05 20:53           ` 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=oluoafam06t.fsf@med.uni-goettingen.de \
    --to=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).