From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joon Ro Subject: Re: Using property values in source code blocks Date: Fri, 15 Jul 2016 21:47:44 -0500 Message-ID: References: , , , , , , , , , , , , , , ,,,,, , , , , , , , , , Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_6e68cb5f-4ea1-4013-8c94-8ec5396a8859_" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOFdv-000094-2j for emacs-orgmode@gnu.org; Fri, 15 Jul 2016 22:47:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bOFdq-0005AR-TA for emacs-orgmode@gnu.org; Fri, 15 Jul 2016 22:47:50 -0400 Received: from col004-omc3s2.hotmail.com ([65.55.34.140]:52833) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOFdq-0005AI-K5 for emacs-orgmode@gnu.org; Fri, 15 Jul 2016 22:47:46 -0400 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: "Charles C. Berry" Cc: "emacs-orgmode@gnu.org" --_6e68cb5f-4ea1-4013-8c94-8ec5396a8859_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable >=20 > Example: >=20 > --8<---------------cut here---------------start------------->8--- >=20 > * Top Heading >=20 > #+NAME: get-property > #+BEGIN_SRC emacs-lisp :noweb yes :var prop=3D"prop" :var pom=3D0 > (car (org-entry-get-multivalued-property pom prop)) > #+END_SRC >=20 > ** Subheading > :PROPERTIES: > :DUMMY: 100 > :END: >=20 > #+BEGIN_SRC shell :noweb yes > echo <> > #+END_SRC >=20 > #+RESULTS: > : 100 >=20 > --8<---------------cut here---------------end--------------->8--- >=20 Hi Chuck=2C Thank you so much. It definitely works when I evaluate the code block - but= my ultimate goal is to tangle the source code (I want to generate bunch of= script files with a template using property values)=2C and when I tangle t= he code block it returns nil. For example: * Top Heading#+NAME: get-property#+BEGIN_SRC emacs-lisp :noweb yes :var pro= p=3D"prop" :var pom=3D0(car (org-entry-get-multivalued-property pom prop))#= +END_SRC** Subheading:PROPERTIES::DUMMY: 100:END:#+BEGIN_SRC shell :noweb y= es :tangle ./tangle-test.shecho <>#+END_SRC When I evaluate the code block=2C I get : 100 results. However=2C when I ta= ngle the block=2C the resulting tangle-test.sh has echo nil instead of echo= 100.=20 Am I doing something wrong? Thank you so much for your help. -Joon = --_6e68cb5f-4ea1-4013-8c94-8ec5396a8859_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable


>=3B
>=3B E= xample:
>=3B
>=3B --8<=3B---------------cut here--------------= -start------------->=3B8---
>=3B
>=3B * Top Heading
>=3B =
>=3B #+NAME: get-property
>=3B #+BEGIN_SRC emacs-lisp :noweb yes= :var prop=3D"prop" :var pom=3D0
>=3B (car (org-entry-get-multivalued-= property pom prop))
>=3B #+END_SRC
>=3B
>=3B ** Subheading<= br>>=3B :PROPERTIES:
>=3B :DUMMY: 100
>=3B :END:
>=3B
= >=3B #+BEGIN_SRC shell :noweb yes
>=3B echo <=3B<=3Bget-property= (prop=3D"DUMMY"=2Cpom=3D(point))>=3B>=3B
>=3B #+END_SRC
>=3B =
>=3B #+RESULTS:
>=3B : 100
>=3B
>=3B --8<=3B-------= --------cut here---------------end--------------->=3B8---
>=3B
<= br>
Hi Chuck=2C

Thank you so much. It de= finitely works when I evaluate the code block - but my ultimate goal is to = tangle the source code (I want to generate bunch of script files with a tem= plate using property values)=2C and when I tangle the code block it returns= nil. For example:

* Top Heading
=
#+NAME: get-property
#+BEGIN_SRC emacs-lisp = :noweb yes :var prop=3D"prop" :var pom=3D0
(car (org-e= ntry-get-multivalued-property pom prop))
#+END_SRC
** Subheading
:PROPERTIES:
:DUMMY: 100
:END:
#+B= EGIN_SRC shell :noweb yes :tangle ./tangle-test.sh
ech= o <=3B<=3Bget-property(prop=3D"DUMMY"=2Cpom=3D(point))>=3B>=3B
#+END_SRC

When= I evaluate the code block=2C I get : 100 results. However=2C when I tangle= the block=2C the resulting tangle-test.sh has =3Becho nil instead of&n= bsp=3Becho 100. =3B

Am I doing something wrong= ? Thank you so much for your help.

-Joon




<= /body> = --_6e68cb5f-4ea1-4013-8c94-8ec5396a8859_--