* [BUG] :header-args+:
@ 2014-07-06 23:42 Thorsten Jolitz
2014-08-06 5:02 ` Aaron Ecay
0 siblings, 1 reply; 3+ messages in thread
From: Thorsten Jolitz @ 2014-07-06 23:42 UTC (permalink / raw)
To: emacs-orgmode
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
`----
I get
,----
| tramp-completion-file-name-handler: Variable binding depth exceeds
| max-specpdl-size
`----
and with Debug on Error enabled globally the following backtrace:
,----
| Debugger entered--Lisp error: (error "Variable binding depth exceeds
| max-specpdl-size")
| org-entry-get(nil "cache" nil nil)
| byte-code("\304\305^H\305
| $\211^R\203^_^@\305\306\307\217\204^U^@eb\210^K`\305\223\210\310\311\n\"\210\305\312\313\217\204^@^@\310\31\
| 1\305\"\210\202^@^@" [property literal-nil tmp
| org-entry-property-inherited-from org-entry-get nil (org-back-to-heading
| t) ((error)) throw \
| ex (org-up-heading-safe) ((error))] 5)
| org-entry-get-with-inheritance("cache" nil)
| org-entry-get(292 "cache" t)
| #[(header-arg) "\302`^H\303#\211^Q\205^S^@\304\305^HP!\306 !B\207"
| [header-arg val org-entry-get t intern ":" org-babel-read] 4]("cach\
| e")
| mapcar(#[(header-arg) "\302`^H\303#\211^Q\205^S^@\304\305^HP!\306
| !B\207" [header-arg val org-entry-get t intern ":" org-babel-read] \
| 4] ("cache" "cmdline" "colnames" "comments" "dir" "eval" "exports"
| "epilogue" "file" "file-desc" "hlines" "mkdirp" "no-expand" "noeval"
| "no\
| web" "noweb-ref" "noweb-sep" "padline" "post" "prologue" "results"
| "rownames" "sep" "session" "shebang" "tangle" "tangle-mode" "var"
| "wrap"\
| ))
| org-babel-params-from-properties("emacs-lisp")
| org-babel-parse-src-block-match()
| org-babel-get-src-block-info()
| org-babel-execute-src-block(nil nil ((:results . "silent")))
| org-babel-ref-resolve("dblock-name")
| org-babel-ref-parse("name=dblock-name")
| #[(el) "^HA:\203 ^@^HA\207\301^HA!\207" [el org-babel-ref-parse]
| 2]((:var . "name=dblock-name"))
| mapcar(#[(el) "^HA:\203 ^@^HA\207\301^HA!\207" [el
| org-babel-ref-parse] 2] ((:var . "name=dblock-name") (:var
| . "prms=dblock-params\
| ")))
| org-babel-process-params(((:comments . "") (:shebang . "") (:cache
| . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:exports
| . "\
| code") (:results . "replace") (:var . "name=dblock-name") (:var
| . "prms=dblock-params") (:hlines . "no") (:session . "none")))
| org-babel-get-src-block-info()
| org-babel-execute-src-block(nil nil ((:results . "silent")))
| org-babel-ref-resolve("dblock-name")
| org-babel-ref-parse("name=dblock-name")
| #[(el) "^HA:\203 ^@^HA\207\301^HA!\207" [el org-babel-ref-parse]
| 2]((:var . "name=dblock-name"))
| mapcar(#[(el) "^HA:\203 ^@^HA\207\301^HA!\207" [el
| org-babel-ref-parse] 2] ((:var . "name=dblock-name") (:var
| . "prms=dblock-params\
| ")))
| org-babel-process-params(((:comments . "") (:shebang . "") (:cache
| . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:exports
| . "\
| code") (:results . "replace") (:var . "name=dblock-name") (:var
| . "prms=dblock-params") (:hlines . "no") (:session . "none")))
| org-babel-get-src-block-info()
| org-babel-execute-src-block(nil nil ((:results . "silent")))
| org-babel-ref-resolve("dblock-name")
| org-babel-ref-parse("name=dblock-name")
| #[(el) "^HA:\203 ^@^HA\207\301^HA!\207" [el org-babel-ref-parse]
| 2]((:var . "name=dblock-name"))
| mapcar(#[(el) "^HA:\203 ^@^HA\207\301^HA!\207" [el
| org-babel-ref-parse] 2] ((:var . "name=dblock-name") (:var
| . "prms=dblock-params\
| ")))
| org-babel-process-params(((:comments . "") (:shebang . "") (:cache
| . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:exports
| . "\
| code") (:results . "replace") (:var . "name=dblock-name") (:var
| . "prms=dblock-params") (:hlines . "no") (:session . "none")))
| org-babel-get-src-block-info()
| org-babel-execute-src-block(nil nil ((:results . "silent")))
`----
PS
#+begin_src emacs-lisp
(call-interactively 'org-version)
#+end_src
#+results:
: Org-mode version beta_8.3 (beta_8.3-21-g815c21 @
/usr/share/emacs/24.3/lisp/org/lisp/)
--
cheers,
Thorsten
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [BUG] :header-args+:
2014-07-06 23:42 [BUG] :header-args+: Thorsten Jolitz
@ 2014-08-06 5:02 ` Aaron Ecay
2014-08-06 8:34 ` Thorsten Jolitz
0 siblings, 1 reply; 3+ messages in thread
From: Aaron Ecay @ 2014-08-06 5:02 UTC (permalink / raw)
To: Thorsten Jolitz, emacs-orgmode
Hi Thorsten,
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.
--
Aaron Ecay
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [BUG] :header-args+:
2014-08-06 5:02 ` Aaron Ecay
@ 2014-08-06 8:34 ` Thorsten Jolitz
0 siblings, 0 replies; 3+ messages in thread
From: Thorsten Jolitz @ 2014-08-06 8:34 UTC (permalink / raw)
To: emacs-orgmode
Aaron Ecay <aaronecay@gmail.com> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-08-06 8:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-06 23:42 [BUG] :header-args+: Thorsten Jolitz
2014-08-06 5:02 ` Aaron Ecay
2014-08-06 8:34 ` Thorsten Jolitz
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).