From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [BUG] Noweb reference eval syntax does not work Date: Sun, 08 May 2016 11:26:31 +0200 Message-ID: <87shxsaojc.fsf@saiph.selenimh> References: <87h9ec2ngz.fsf@fm4d.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azKzL-0007K5-SU for emacs-orgmode@gnu.org; Sun, 08 May 2016 05:27:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1azKzH-0008P1-JV for emacs-orgmode@gnu.org; Sun, 08 May 2016 05:26:58 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:45974) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azKzH-0008Or-9o for emacs-orgmode@gnu.org; Sun, 08 May 2016 05:26:55 -0400 In-Reply-To: <87h9ec2ngz.fsf@fm4d.net> (fm4d's message of "Thu, 05 May 2016 23:39:56 +0200") 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" To: fm4d Cc: emacs-orgmode@gnu.org Hello, fm4d writes: > The noweb reference syntax that should insert results of > evaluation of src block itself instead of src block as > described in `org-babel-expand-noweb-reference` does not > seems to work. > > > Code for replication: > > * Assign=20 > > First we assign abc: > > #+begin_src python :noweb-ref assign_abc > abc =3D "abc" + "def" > #+end_src > > * Use > > Then we use it in a function: > > #+begin_src python :noweb tangle :tangle noweb-test.py > def x(): > <> > return abc > > print(x()) > #+end_src > > > <> does work, fails with this error: > > (error "Reference =E2=80=98assign_abc=E2=80=99 not found in this buffer") > signal(error ("Reference =E2=80=98assign_abc=E2=80=99 not found in this= buffer")) > error("Reference `%s' not found in this buffer" "assign_abc") > org-babel-ref-resolve("assign_abc()") > ... > > > I am not sure if this is a bug or I am doing something wrong, > the documentation on this feature is not very comprehensive. I just discovered the :noweb-ref parameter. It is redundant with #+NAME: keyword and slightly broken. Also it induces hacks like `org-babel-use-quick-and-dirty-noweb-expansion' to work-around its shortcomings.=20 Besides, it doesn't make much sense to add the same parameters to a bunch of blocks, so I find the syntax dubious. I understand it can be a handy shortcut for inserting multiple blocks, but, all in all, I tend to think it would be simpler to just remove the feature, along with `:noweb-sep' and `org-babel-use-quick-and-dirty-noweb-expansion'. What do you, and others, think? Is NAME enough for noweb syntax, or is there a real need fo :noweb-ref? Regards, --=20 Nicolas Goaziou