From mboxrd@z Thu Jan 1 00:00:00 1970 From: "numbchild@gmail.com" Subject: How to use noweb reference with argument in other languages? Date: Mon, 19 Jun 2017 12:57:44 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1146fb7c8f1cc6055248fb77" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:32858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMolV-0002SI-Uk for emacs-orgmode@gnu.org; Mon, 19 Jun 2017 00:58:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dMolU-0005vk-RC for emacs-orgmode@gnu.org; Mon, 19 Jun 2017 00:58:18 -0400 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:37056) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dMolU-0005v7-H1 for emacs-orgmode@gnu.org; Mon, 19 Jun 2017 00:58:16 -0400 Received: by mail-wm0-x22e.google.com with SMTP id d73so62997100wma.0 for ; Sun, 18 Jun 2017 21:58:16 -0700 (PDT) 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: Org-mode --001a1146fb7c8f1cc6055248fb77 Content-Type: text/plain; charset="UTF-8" I found noweb reference with argument `<>` issue. This can work: ```org #+NAME: f1 #+BEGIN_SRC emacs-lisp :var x=7 :results value (+ x x) #+END_SRC #+RESULTS: f1 : 14 #+NAME: f2 #+BEGIN_SRC emacs-lisp :var x=7 :results value (+ x 2) #+END_SRC #+RESULTS: f2 : 9 #+name: intermediate #+call: f1(x=5) #+RESULTS: intermediate : 10 #+call: f2(x=intermediate) #+RESULTS: : 12 #+name: intermediate #+BEGIN_SRC emacs-lisp :noweb yes :results value <> #+END_SRC #+BEGIN_SRC emacs-lisp :noweb yes :results value <> #+END_SRC #+RESULTS: : 12 ``` And this does not work: ```org #+NAME: sh-print-something #+BEGIN_SRC sh :var str="" echo "$str" #+END_SRC #+BEGIN_SRC sh :results output :noweb yes echo "hello, " <> #+END_SRC #+RESULTS: ``` Why the first language `emacs-lisp` works, but second `sh` does not work? [stardiviner] GPG key ID: 47C32433 IRC(freeenode): stardiviner Twitter: @numbchild Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 Blog: http://stardiviner.github.io/ --001a1146fb7c8f1cc6055248fb77 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I found noweb reference with argument `<<= ;src-block-name(args)>>` issue.


```org
#+NAME: f1
#+BEGIN_SRC emacs-lisp :var x=3D7 :results= value
=C2=A0 (+ x x)
#+END_SRC

#+RESULTS: f1<= /font>
: 14

#+NAME: f2
#+BEGIN_SRC emacs-lisp :var = x=3D7 :results value
=C2=A0 (+ x 2)
#+END_SRC

=
= #+RESULTS: f2
: 9

#+name: intermediate
<= div class=3D"gmail_default">#+call:= f1(x=3D5)

#+RESULTS: intermediate
: 10

=
#+call: f2(x=3Dintermediate)

#+RESULTS:
: 12<= /font>


#+name: intermediate
#+BEGIN_SRC emac= s-lisp :noweb yes :results value
<= font face=3D"trebuchet ms, sans-serif"><<f1(x=3D5)>>
#+EN= D_SRC

#+BEGIN_SRC emacs-lisp :noweb yes :results value
<<f2(x=3Dintermediate)>>
#+END_SRC

#+= RESULTS:
: 12
```

=
And this does not work:
```org
#+NAME: sh-print-something
#+BEGIN_SRC sh :var str=3D&qu= ot;"
echo "$str"
#+END_SRC

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

#+RESULTS:
```

Why the first language `emacs-lisp` works, bu= t second `sh` does not work?

[stardi= viner]=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 fingerprint =3D 9BAA 92BC CDDD B9EF 3B36=C2=A0 CB99 B= 8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/
<= /div>
--001a1146fb7c8f1cc6055248fb77--