From 77710ec2628a0c8b0a2be05ca51c57bcb0649e04 Mon Sep 17 00:00:00 2001 From: Michael Brand Date: Fri, 15 Nov 2013 19:20:25 +0100 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 b1f170242..449824fc2 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")))