From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Mankoff Subject: Re: :tangle header argument not picked up in #+PROPERTY line or :PROPERTIES: block Date: Tue, 31 Mar 2020 08:14:04 -0700 Message-ID: References: <87imiof8d3.fsf@fastmail.fm> <77D76CC7-D45E-40A4-9D67-97057256B1E5@ucsd.edu> <878sji2a2i.fsf@fastmail.fm> <63056638-1FBC-495A-BAD0-31ACC44EEFBC@health.ucsd.edu> <877dz2et7r.fsf@fastmail.fm> <87lfnizsus.fsf@fastmail.fm> <874ku57aol.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000dfb2e405a228063e" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:59550) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJIbD-0002bI-GU for emacs-orgmode@gnu.org; Tue, 31 Mar 2020 11:14:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJIbC-0003Nf-AQ for emacs-orgmode@gnu.org; Tue, 31 Mar 2020 11:14:43 -0400 Received: from mail-yb1-xb2a.google.com ([2607:f8b0:4864:20::b2a]:35906) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJIbC-0003N9-5o for emacs-orgmode@gnu.org; Tue, 31 Mar 2020 11:14:42 -0400 Received: by mail-yb1-xb2a.google.com with SMTP id i4so11351203ybl.3 for ; Tue, 31 Mar 2020 08:14:41 -0700 (PDT) In-Reply-To: <874ku57aol.fsf@fastmail.fm> 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: "Berry, Charles" , emacs-orgmode@gnu.org --000000000000dfb2e405a228063e Content-Type: text/plain; charset="UTF-8" Yes I'm sure. From the link Thomas sent, Any property specification, unless it is postfixed with a `+`, will *reset* the value of that property to its current value. C-c C-v (for me, Charles uses C-c C-v C-i) withitn a code block shows you the header args that are set for that block. Useful for debugging. -k. On Mon, Mar 30, 2020 at 3:24 PM Joost Kremers wrote: > > On Mon, Mar 30 2020, Ken Mankoff wrote: > > Header args overwrite. Change python to python+ to append header > > args. > > Are you sure? That's not documented anywhere I can find and it > seems to be belied by the fact that if I put the headers in the > order: > > ``` > :PROPERTIES: > :header-args:python: :tangle out1.py > :header-args:python: :session py1 :results function > :END: > ``` > > everything works as I would expect (the code blocks are tangled to > a file `out1.py` *and* they are evaluated in a python session > `py1`), meaning that *all* header args are picked up. > > If I reverse the order and add a `+` sign, like so: > > ``` > :PROPERTIES: > :header-args:python+: :session py1 :results function > :header-args:python+: :tangle out1.py > :END: > ``` > > the code does indeed get tangled, but the `:results` header arg > isn't picked up, because the code block doesn't produce any > output. > > For reference, this is my test file: > > ``` > * Header 1 > :PROPERTIES: > :header-args:python+: :session py1 :results function > :header-args:python+: :tangle out1.py > :END: > > #+begin_src python > a=1 > b=2 > c=a+b > return c > #+end_src > > #+RESULTS: > ``` > > > -- > Joost Kremers > Life has its moments > --000000000000dfb2e405a228063e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Yes I'm sure. From the link Thomas sent,

Any property specification, unless it is postfixed with a `+`, will *reset*= the value of that property to its current value.

C-c C-v <TAB> (for me= , Charles uses C-c C-v C-i) withitn a code block shows you the header args = that are set for that block. Useful for debugging.
=C2=A0
=C2=A0 -k.
<= /div>

On Mon, Mar 30, 2020 at 3:24 PM Joost Kremers <joostkremers@fastmail.fm> wrote:

On Mon, Mar 30 2020, Ken Mankoff wrote:
> Header args overwrite. Change python to python+ to append header
> args.

Are you sure? That's not documented anywhere I can find and it
seems to be belied by the fact that if I put the headers in the
order:

```
:PROPERTIES:
:header-args:python: :tangle out1.py
:header-args:python: :session py1 :results function
:END:
```

everything works as I would expect (the code blocks are tangled to
a file `out1.py` *and* they are evaluated in a python session
`py1`), meaning that *all* header args are picked up.

If I reverse the order and add a `+` sign, like so:

```
:PROPERTIES:
:header-args:python+: :session py1 :results function
:header-args:python+: :tangle out1.py
:END:
```

the code does indeed get tangled, but the `:results` header arg
isn't picked up, because the code block doesn't produce any
output.

For reference, this is my test file:

```
* Header 1
:PROPERTIES:
:header-args:python+: :session py1 :results function
:header-args:python+: :tangle out1.py
:END:

#+begin_src python
a=3D1
b=3D2
c=3Da+b
return c
#+end_src

#+RESULTS:
```


--
Joost Kremers
Life has its moments
--000000000000dfb2e405a228063e--