From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: Org Babel resolution of `:var` value reference inconsistent Date: Mon, 02 Nov 2015 09:01:21 +0000 Message-ID: References: <8737woetng.fsf@toshiba.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtAzi-0007iU-85 for emacs-orgmode@gnu.org; Mon, 02 Nov 2015 04:01:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtAzd-0000GC-En for emacs-orgmode@gnu.org; Mon, 02 Nov 2015 04:01:38 -0500 Received: from plane.gmane.org ([80.91.229.3]:37456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtAzd-0000G5-81 for emacs-orgmode@gnu.org; Mon, 02 Nov 2015 04:01:33 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZtAzb-0001Hc-J6 for emacs-orgmode@gnu.org; Mon, 02 Nov 2015 10:01:31 +0100 Received: from 193.63.223.107 ([193.63.223.107]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 Nov 2015 10:01:31 +0100 Received: from andreas.leha by 193.63.223.107 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 Nov 2015 10:01:31 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi myq, myq writes: > Sometime since Org version 8.3beta and now, the way Org Babel resolves > the value of the `:var` header argument when assigned to a reference has > changed. > > Previously, the following would work when exporting: > > * test > > #+BEGIN_SRC R :var dat=table-data > print(summary(dat)); > #+END_SRC > > ** COMMENT > > #+TBLNAME: table-data > | number | measurement | > |--------+-------------| > | 1 | 10 | > > > The above /still/ works when manually evaluating the block (C-c C-c whil > in the block), but when exporting, the following error is thrown: > `org-babel-ref-resolve: Reference `table-data' not found in this buffer` > > Curiously, the following tweak works for both manual evaluation and for > exporting and produces the same results that the above file used to > produce: > > #+OPTIONS: inline:nil > * test > > #+BEGIN_SRC R :var dat=table-data > print(summary(dat)); > #+END_SRC > > *************** test > #+TBLNAME: table-data > | number | measurement | > |--------+-------------| > | 1 | 10 | > *************** END > > This seems to be a bug, but perhaps there is a reason for this new > behaviour? > > Thank you in advance for any insights. There are two ways to exclude subtrees from export: the COMMENT keyword and the :noexport: tag. I think what you want to use here is the :noexport: tag. Here is the difference: - COMMENTing a subtree is meant to be (roughly?) the same as putting '# ' at the beginning of all the lines from that region. - The :noexport: tag will simply skip the region from export. 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. HTH, Andreas