Babel: add comments to ERT for reading properties
* testing/examples/babel.org (use case of reading entry properties): Add comments to function definitions.
This commit is contained in:
parent
668ba5de0e
commit
77710ec262
|
@ -413,6 +413,9 @@ Note: Just export of a property can be done with a macro: {{{property(a)}}}.
|
||||||
|
|
||||||
**** function definition
|
**** function definition
|
||||||
|
|
||||||
|
comments for ":var":
|
||||||
|
- The "or" is to deal with a property not present.
|
||||||
|
- The t is to get property inheritance.
|
||||||
#+NAME: src_block_location_shell
|
#+NAME: src_block_location_shell
|
||||||
#+HEADER: :var a=(or (org-entry-get org-babel-current-src-block-location "a" t) "0")
|
#+HEADER: :var a=(or (org-entry-get org-babel-current-src-block-location "a" t) "0")
|
||||||
#+HEADER: :var b=(or (org-entry-get org-babel-current-src-block-location "b" t) "0")
|
#+HEADER: :var b=(or (org-entry-get org-babel-current-src-block-location "b" t) "0")
|
||||||
|
@ -433,6 +436,11 @@ Note: Just export of a property can be done with a macro: {{{property(a)}}}.
|
||||||
#+HEADER: :var e='nil
|
#+HEADER: :var e='nil
|
||||||
#+BEGIN_SRC emacs-lisp :exports results
|
#+BEGIN_SRC emacs-lisp :exports results
|
||||||
(setq
|
(setq
|
||||||
|
;; - The first `or' together with ":var <var>='nil" is to check for
|
||||||
|
;; a value bound from an optional call argument, in the examples
|
||||||
|
;; here: c=5, e=6
|
||||||
|
;; - The second `or' is to deal with a property not present
|
||||||
|
;; - The t is to get property inheritance
|
||||||
a (or a (string-to-number
|
a (or a (string-to-number
|
||||||
(or (org-entry-get org-babel-current-src-block-location "a" t)
|
(or (org-entry-get org-babel-current-src-block-location "a" t)
|
||||||
"0")))
|
"0")))
|
||||||
|
|
Loading…
Reference in New Issue