better error message for unassigned variables

* lisp/ob.el (org-babel-merge-params): Better error message for
  unassigned variables.
This commit is contained in:
Eric Schulte 2011-09-08 11:33:04 -06:00
parent be69dd2d50
commit a4e881207d
1 changed files with 10 additions and 6 deletions

View File

@ -1843,12 +1843,16 @@ parameters when merging lists."
vars))
vars)
(list (cons name pair))))
;; if no name is given, then assign to variables in order
(prog1 (setf (cddr (nth variable-index vars))
(concat (symbol-name
(car (nth variable-index vars)))
"=" (cdr pair)))
(incf variable-index)))))
;; if no name is given and we already have named variables
;; then assign to named variables in order
(if (and vars (nth variable-index vars))
(prog1 (setf (cddr (nth variable-index vars))
(concat (symbol-name
(car (nth variable-index vars)))
"=" (cdr pair)))
(incf variable-index))
(error "variable \"%s\" must be assigned a default value"
(cdr pair))))))
(:results
(setq results (e-merge results-exclusive-groups
results