Check that functional-syntax variables are initialized.

* lisp/ob.el (org-babel-get-src-block-info): Check that
  functional-syntax variables are initialized.
This commit is contained in:
Eric Schulte 2011-09-15 09:24:29 -06:00
parent f075ada9a1
commit 11f07576cb
1 changed files with 9 additions and 2 deletions

View File

@ -220,8 +220,15 @@ Returns a list
(when (match-string 6)
(setf (nth 2 info) ;; merge functional-syntax vars and header-args
(org-babel-merge-params
(mapcar (lambda (ref) (cons :var ref))
(org-babel-ref-split-args (match-string 6)))
(mapcar
(lambda (ref) (cons :var ref))
(mapcar
(lambda (var) ;; check that each variable is initialized
(unless (string-match ".+=.+" var)
(error
"variable \"%s\"%s must be assigned a default value"
var (if name (format " in block \"%s\"" name) ""))))
(org-babel-ref-split-args (match-string 6))))
(nth 2 info))))))
;; inline source block
(when (org-babel-get-inline-src-block-matches)