summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brand <michael.ch.brand@gmail.com>2013-11-15 19:20:25 +0100
committerMichael Brand <michael.ch.brand@gmail.com>2013-11-15 19:20:25 +0100
commit77710ec2628a0c8b0a2be05ca51c57bcb0649e04 (patch)
tree92c95196597f2aa56c07d0a62e47504c22151e5f
parent668ba5de0e6683705359273977bd54f98453a53c (diff)
downloadorg-mode-77710ec2628a0c8b0a2be05ca51c57bcb0649e04.tar.gz
Babel: add comments to ERT for reading properties
* testing/examples/babel.org (use case of reading entry properties): Add comments to function definitions.
-rw-r--r--testing/examples/babel.org8
1 files changed, 8 insertions, 0 deletions
diff --git a/testing/examples/babel.org b/testing/examples/babel.org
index b1f1702..449824f 100644
--- a/testing/examples/babel.org
+++ b/testing/examples/babel.org
@@ -413,6 +413,9 @@ Note: Just export of a property can be done with a macro: {{{property(a)}}}.
**** 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
#+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")
@@ -433,6 +436,11 @@ Note: Just export of a property can be done with a macro: {{{property(a)}}}.
#+HEADER: :var e='nil
#+BEGIN_SRC emacs-lisp :exports results
(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
(or (org-entry-get org-babel-current-src-block-location "a" t)
"0")))