emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sharing variables between source blocks without session


From: Loris Bennett
Subject: Re: Sharing variables between source blocks without session
Date: Fri, 19 Mar 2021 14:59:19 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> On Friday, 19 Mar 2021 at 07:38, Loris Bennett wrote:
>> However, the restriction to source blocks of a particular language does
>> not seem to work like this, but maybe I have got the syntax wrong
>> (again).
>
> Maybe ;-)
>
> This seems to work for me for a shell:
>
> :PROPERTIES:
> :header-args:sh: :var user="loris"
> :END:

That works for me, too.  The following correctly does not work:

  :PROPERTIES:
  :header-args:R: :var user="loris"
  :END:

  #+begin_src sh
    echo user ${user}
  #+end_src

  #+RESULTS:
  : user

To be honest, I find it is a wee bit confusing that it's

  #+PROPERTY: header-args:sh :var user="loris"

*without* a colon after the language (if I add it, there is not error,
but the variable is just not set) but

  :PROPERTIES:
  :header-args:sh: :var user="loris"
  :END:

*with* a colon after the language, but maybe I'm just easily confused
 :-)

Thanks for the help,

Loris
-- 
This signature is currently under construction.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]