From 0b7caf6adfcab1a6ad2b1aa330e7bd15c3be33d3 Mon Sep 17 00:00:00 2001 From: Michael Brand Date: Thu, 10 Oct 2013 11:02:19 +0200 Subject: [PATCH] Babel: add comments to ERT for reading properties * testing/examples/babel.org (use case of reading entry properties): Add comments to function definitions. --- testing/examples/babel.org | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/testing/examples/babel.org b/testing/examples/babel.org index b1f1702..5c71834 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 ='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"))) -- 1.7.12.4 (Apple Git-37)