Browse Source

babel: fixed error resolving references on export

  Thanks to Nicolas Goaziou for reporting this problem
Eric Schulte 14 years ago
parent
commit
afab7897a5
2 changed files with 4 additions and 2 deletions
  1. 2 1
      contrib/babel/lisp/org-babel-exp.el
  2. 2 1
      contrib/babel/lisp/org-babel-ref.el

+ 2 - 1
contrib/babel/lisp/org-babel-exp.el

@@ -177,7 +177,8 @@ suitable for exportation by org-mode.  This function is called by
 	  (lambda (pair)
 	    (if (and org-current-export-file
 		     (eq (car pair) :var)
-		     (string-match org-babel-ref-split-regexp (cdr pair)))
+		     (string-match org-babel-ref-split-regexp (cdr pair))
+		     (null (org-babel-ref-literal (match-string 2 (cdr pair)))))
 		`(:var . ,(concat (match-string 1 (cdr pair))
 				  "=" org-current-export-file
 				  ":" (match-string 2 (cdr pair))))

+ 2 - 1
contrib/babel/lisp/org-babel-ref.el

@@ -84,7 +84,8 @@ emacs-lisp representation of the value of the variable."
 (defun org-babel-ref-literal (ref)
   "Determine if the right side of a header argument variable
 assignment is a literal value or is a reference to some external
-resource.  If REF is literal then return it's value, otherwise
+resource.  REF should be a string of the right hand side of the
+assignment.  If REF is literal then return it's value, otherwise
 return nil."
   (let ((out (org-babel-read ref)))
     (if (equal out ref)