[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [BUG] :header-args+:
From: |
Thorsten Jolitz |
Subject: |
Re: [O] [BUG] :header-args+: |
Date: |
Wed, 06 Aug 2014 10:34:20 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Aaron Ecay <address@hidden> writes:
Hi Aaron,
> 2014ko uztailak 6an, Thorsten Jolitz-ek idatzi zuen:
>>
>> Hi List,
>>
>> doing C-c C-c on the first src_block
>>
>> ,----
>> | * A
>> | ** B
>> | :PROPERTIES:
>> | :header-args: :var name=dblock-name
>> | :header-args+: :var prms=dblock-params
>> | :END:
>> |
>> | #+begin_src emacs-lisp
>> | (format "\n#+begin: %s %s\n#+end:\n" name prms)
>> | #+end_src
>> |
>> | #+name: dblock-params
>> | #+begin_src emacs-lisp
>> | foo
>> | #+end_src
>> |
>> | #+name: dblock-name
>> | #+begin_src emacs-lisp
>> | bar
>> | #+end_src
>> `----
>>
>
> You have an infinite regress. In order to compute the result of the
> dblock-name block, we need to resolve each of its :vars, which includes
> dblock-name, so we try to resolve the same block again...
>
> Converting the second and third src blocks to example blocks (leaving in
> place the #+names) gives what you seem to be aiming for.
Yes, that works (see below), thank you. I already solved my problem in
plain Emacs Lisp, and example-blocks cannot really replace src-blocks,
but its good to know for the future that it (somehow) can be done.
* A
** B
:PROPERTIES:
:header-args: :var name=dblock-name
:header-args+: :var prms=dblock-params
:END:
#+begin_src emacs-lisp
(format "\n#+begin: %s %s\n#+end:\n" name prms)
#+end_src
#+results:
:
: #+begin: bar
: foo
:
: #+end:
#+name: dblock-params
#+begin_example
foo
#+end_example
#+name: dblock-name
#+begin_example
bar
#+end_example
--
cheers,
Thorsten