From mboxrd@z Thu Jan 1 00:00:00 1970 From: "numbchild@gmail.com" Subject: Re: How to use noweb reference with argument in other languages? Date: Tue, 20 Jun 2017 07:40:44 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a11478d90b1fb96055258ab56" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dN6IH-0006Te-MV for emacs-orgmode@gnu.org; Mon, 19 Jun 2017 19:41:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dN6IG-0000ri-Bn for emacs-orgmode@gnu.org; Mon, 19 Jun 2017 19:41:17 -0400 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:37931) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dN6IG-0000rT-1b for emacs-orgmode@gnu.org; Mon, 19 Jun 2017 19:41:16 -0400 Received: by mail-wm0-x22a.google.com with SMTP id u195so5967315wmd.1 for ; Mon, 19 Jun 2017 16:41:15 -0700 (PDT) In-Reply-To: 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: Kaushal Modi Cc: emacs-org list --001a11478d90b1fb96055258ab56 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Which Org-mode version are you using? I'm using the latest Org-mode version from source code branch `master`. When I use your `:noweb-ref` style like this: ```org * noweb reference with argument #+BEGIN_SRC sh :var str=3D"" :noweb-ref sh-print-something echo "$str" #+END_SRC #+BEGIN_SRC sh :results output :noweb yes echo "hello, " <> #+END_SRC #+RESULTS: ``` Emacs reports error: org-babel-ref-resolve: Reference =E2=80=98sh-print-something=E2=80=99 not f= ound in this buffer. Org-mode version: Org mode version 9.0.8 (9.0.8-elpaplus @ /home/stardiviner/Code/Emacs/org-mode/lisp/) [stardiviner] GPG key ID: 47C32433 IRC(freeenode): stardiviner Twitter: @numbchild Key fingerprint =3D 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 Blog: http://stardiviner.github.io/ On Mon, Jun 19, 2017 at 6:21 PM, Kaushal Modi wrote: > On Mon, Jun 19, 2017, 12:59 AM numbchild@gmail.com > wrote: > >> I found noweb reference with argument `<>` issue. >> > > It has been working fine for me for org and sh source blocks. > > And this does not work: >> ```org >> #+NAME: sh-print-something >> #+BEGIN_SRC sh :var str=3D"" >> echo "$str" >> #+END_SRC >> >> #+BEGIN_SRC sh :results output :noweb yes >> echo "hello, " >> <> >> #+END_SRC >> > > You need to use :noweb-ref option in the source blocks header args to se= t > the noweb-ref code reference; #+NAME will not work. > > I have to have used noweb for the very first time in this recent project: > https://raw.githubusercontent.com/kaushalmodi/eless/master/eless.org ; > search for ":noweb-ref" in there to get an idea. > >> -- > > Kaushal Modi > --001a11478d90b1fb96055258ab56 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Which Org-mode version are you using? I'm = using the latest Org-mode version from source code branch `master`.

When I use your `:noweb-ref` style like thi= s:

```org
=
#+BEGIN_SRC sh :var str= =3D"" :noweb-ref sh-print-something
echo "$str"
#+END_SRC

#+BEGIN_SRC sh :results output :noweb yes
echo "hello, "
<<sh-print-something(str=3D"= stardiviner")>>
#+END_SRC

#+RESULTS:
```
=
Emacs reports error:

org-babel-ref-resolve: Reference =E2=80=98sh-print-something=E2= =80=99 not found in this buffer.

Org-mode version:=C2= =A0Org mode version 9.0.8 (9.0.8-elpaplus @ /home/stardiviner/Code/Emacs/or= g-mode/lisp/)

[stardiviner]=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Hack this world!>=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 GPG key ID: 47C32433
IRC(freeenode): stardiviner =C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Twitter:=C2=A0 @numbchild
Key finge= rprint =3D 9BAA 92BC CDDD B9EF 3B36=C2=A0 CB99 B8C4 B8E5 47C3 2433
Blog:= http://stardiv= iner.github.io/

On Mon, Jun 19, 2017 at 6:21 PM, Kaushal Mod= i <kaushal.modi@gmail.com> wrote:
= On Mon, Jun 19, 2017, 12:59 AM numbchild@gmail.com <numbchild@gmail.com> wrote:
I found noweb referenc= e with argument `<<src-block-name(args)>>` issue.

It has been working fine for me= for org and sh source blocks.=C2=A0

<= div class=3D"gmail_quote">
<= div class=3D"gmail_default">
And this does not work:
```org
#+NAME: sh-print-something<= /div>
#= +BEGIN_SRC sh :var str=3D""
echo "$str"
#+E= ND_SRC

#+BEGIN_SRC sh :results output :noweb yes
ech= o "hello, "
<<sh-print-something(str=3D"s= tardiviner")>>
#+END_SRC

You need to use :noweb-ref optio= n =C2=A0in the source blocks header args to set the noweb-ref code referenc= e; #+NAME will not work.

I have to have used noweb= for the very first time in this recent project:=C2=A0https://raw.githubusercontent.com/kaushalmodi/eless/master/eless.org ; search for ":noweb-ref" in there to get an idea= .=C2=A0
--

Kaushal Modi


--001a11478d90b1fb96055258ab56--