From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Berry, Charles" via "General discussions about Org-mode." Subject: Re: :tangle header argument not picked up in #+PROPERTY line or :PROPERTIES: block Date: Sun, 29 Mar 2020 20:41:21 +0000 Message-ID: <63056638-1FBC-495A-BAD0-31ACC44EEFBC@health.ucsd.edu> References: <87imiof8d3.fsf@fastmail.fm> <77D76CC7-D45E-40A4-9D67-97057256B1E5@ucsd.edu> <878sji2a2i.fsf@fastmail.fm> Reply-To: "Berry, Charles" Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:47180) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIekN-0006hE-4n for emacs-orgmode@gnu.org; Sun, 29 Mar 2020 16:41:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jIekL-0003E1-LQ for emacs-orgmode@gnu.org; Sun, 29 Mar 2020 16:41:30 -0400 Received: from mx0b-00395d01.pphosted.com ([148.163.137.170]:18654) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jIekL-0003DL-5i for emacs-orgmode@gnu.org; Sun, 29 Mar 2020 16:41:29 -0400 In-Reply-To: <878sji2a2i.fsf@fastmail.fm> Content-Language: en-US Content-ID: 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-mx.org@gnu.org Sender: "Emacs-orgmode" To: Joost Kremers Cc: "emacs-orgmode@gnu.org" > On Mar 29, 2020, at 1:13 PM, Joost Kremers wro= te: >=20 >=20 > On Sun, Mar 29 2020, Berry, Charles via General discussions about Org-mod= e. wrote: >>> On Mar 28, 2020, at 3:00 PM, Joost Kremers w= rote: >>> Is this expected behaviour? Am I doing something wrong? >>=20 >> IIUC what you did, then yes and yes. >>=20 >> This is the accepted idiom: >>=20 >> #+PROPERTY: header-args :tangle yes >=20 What we really need is an ECM rather than snippets of code. This ECM works for me: #+begin_src org ,* try python :PROPERTIES: :header-args:python: :tangle yes :END: ,#+begin_src python "a+b" ,#+end_src #+end_src producing a file of the same name with the .py extension with one line cont= aining "a+b". I am on release Org mode version 9.3.6 (release_9.3.6-442-g97f0f1 ), but th= is also work on release_9.3-34-g2eee3c HTH, Chuck p.s. `M-x org-lint' may reveal some issues with your file that might not be= obvious to the eye. > I have tried: >=20 > #+begin_example > #+PROPERTY: header-args:python :tangle yes :dir /home/joost/tmp/dlpy > #+end_example >=20 > which AFAICT is the syntax shown in the info node you mentioned. I have a= lso tried a file name instead of =3Dyes=3D, both with and without quotes, b= ut it doesn't work. >=20 > What I really want is to have a property block with the =3D:tangle=3D arg= under each top-level header, like so: >=20 > #+begin_example > :PROPERTIES: > :header-args:python: :tangle out1.py > :END: > #+begin_example >=20 > because I want the code below each top-level header to be tangled to a se= parate file. Again, AFAICT this is the syntax described in the info manual. >=20 > Hmm, experimenting a bit more I find that if I leave out the =3Dpython=3D= part, it works: >=20 > #+begin_example > :PROPERTIES: > :header-args: :tangle out1.py > :END: > #+begin_example >=20 > But the info manual gives this example: >=20 > #+begin_example > :PROPERTIES: > :header-args:clojure: :session *clojure-1* > :END: > #+begin_example >=20 > The same is true for the #+PROPERTY block at the top of the file: leave o= ut the =3Dpython=3D, it works. Isn't it possible to restrict tangling to so= urce blocks of a particular language? (Or, more specifically what I want: t= o specify different tangling targets for different language? I wanted to ha= ve both python and bash code blocks under one header and have them tangled = to different files...) >=20 > Joost >=20 >=20 > --=20 > Joost Kremers > Life has its moments