From mboxrd@z Thu Jan 1 00:00:00 1970 From: "numbchild@gmail.com" Subject: babel header argument :var is not expanded when tangling Date: Sun, 24 Dec 2017 11:16:39 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="f4030437ab283c0a1905610d7c5a" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:32838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eSwmm-0000cL-Hk for emacs-orgmode@gnu.org; Sat, 23 Dec 2017 22:17:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eSwml-0006Xg-Ee for emacs-orgmode@gnu.org; Sat, 23 Dec 2017 22:17:12 -0500 Received: from mail-ot0-x22d.google.com ([2607:f8b0:4003:c0f::22d]:33134) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eSwml-0006Wh-8w for emacs-orgmode@gnu.org; Sat, 23 Dec 2017 22:17:11 -0500 Received: by mail-ot0-x22d.google.com with SMTP id h9so27979264oti.0 for ; Sat, 23 Dec 2017 19:17:11 -0800 (PST) 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 --f4030437ab283c0a1905610d7c5a Content-Type: text/plain; charset="UTF-8" Here is a quick test: * Test tangle will auto expand and substitute :var #+begin_src js :tangle kk.js console.log("hello, world!"); #+end_src #+begin_src js :var name="chris" :tangle require-kk.js // require("kk.js"); console.log("Hi, ", name); #+end_src #+RESULTS: : Hi, chris #+NAME: check whether tangle expand and substitute :var #+begin_src shell cat require-kk.js #+end_src #+RESULTS: check whether tangle expand and substitute :var : var name="chris"; : console.log("Hi, ", name); The upper result should be: ~console.log("Hi, ", "chris");~. [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/ --f4030437ab283c0a1905610d7c5a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Here is a quick test:
* Test tangle will auto expand and substitute :var

#+begin_src js :tangle kk.js
console.log("hello, world!");
#+end_src

#+begin_src js :var name=3D"chris" :tangle require-kk.js
// require("kk.js");
console.log("Hi, ", name);
#+end_src

#+RESULTS:
: Hi,  chris

#+NAME: check whether tangle expand and substitute :var
#+begin_src shell
cat require-kk.js
#+end_src

#+RESULTS: check whether tangle expand and substitute :var
: var name=3D"chris";
: console.log("Hi, ", name);

The upper result should be: ~console.log("Hi, ", "chris"=
;);~.
  
=
[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(freeen= ode): 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 @n= umbchild
Key fingerprint =3D 9BAA 92BC CDDD B9EF 3B36=C2=A0 CB99 B8C4 B8= E5 47C3 2433
Blog: http://stardiviner.github.io/
--f4030437ab283c0a1905610d7c5a--