Browse Source

added 'var' as a possible header argument to be read from outline properties

Eric Schulte 16 years ago
parent
commit
8506995b9d
2 changed files with 4 additions and 2 deletions
  1. 1 1
      lisp/org-babel.el
  2. 3 1
      org-babel.org

+ 1 - 1
lisp/org-babel.el

@@ -325,7 +325,7 @@ may be specified in the properties of the current outline entry."
                (when val
                  ;; (message "param-from-property %s=%s" header-arg val) ;; debugging statement
                  (cons (intern (concat ":" header-arg)) val))))
-           '("results" "exports" "tangle")))))
+           '("results" "exports" "tangle" "var")))))
 
 (defun org-babel-parse-src-block-match ()
   (let* ((lang (org-babel-clean-text-properties (match-string 1)))

+ 3 - 1
org-babel.org

@@ -1144,6 +1144,7 @@ to the command if BUFF is not given.)
 *** test-header with properties
     :PROPERTIES:
     :tangle:   yes
+    :var:      def=8
     :END:
 
 Ahh... as is so often the case, just had to wrap
@@ -1154,8 +1155,9 @@ Ahh... as is so often the case, just had to wrap
 
 #+srcname: default-props-implementation
 #+begin_src emacs-lisp :tangle no :var my-lis=why-def-props-cause-probs :results silent
-(length my-lis)
+(+ (length my-lis) def)
 #+end_src
+
 ** DONE new reference syntax *inside* source code blocks
 This is from an email discussion on the org-mode mailing list with
 Sébastien.  The goal here is to mimic the source-block reference style