diff --git a/lisp/babel/ob-exp.el b/lisp/babel/ob-exp.el index a12f2795f..c6a4f4936 100644 --- a/lisp/babel/ob-exp.el +++ b/lisp/babel/ob-exp.el @@ -245,7 +245,8 @@ results into the buffer." (if (and org-current-export-file (eq (car pair) :var) (string-match org-babel-ref-split-regexp (cdr pair)) - (null (org-babel-ref-literal (match-string 2 (cdr pair))))) + (equal :ob-must-be-reference + (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)))) diff --git a/lisp/babel/ob-ref.el b/lisp/babel/ob-ref.el index 36bbcbd21..df8a0338e 100644 --- a/lisp/babel/ob-ref.el +++ b/lisp/babel/ob-ref.el @@ -83,8 +83,10 @@ emacs-lisp representation of the value of the variable." (let ((var (match-string 1 assignment)) (ref (match-string 2 assignment))) (cons (intern var) - (or (org-babel-ref-literal ref) - (org-babel-ref-resolve-reference ref params)))))) + ((lambda (val) + (if (equal :ob-must-be-reference val) + (org-babel-ref-resolve-reference ref params) + val)) (org-babel-ref-literal ref)))))) (defun org-babel-ref-literal (ref) "Determine if the right side of a header argument variable @@ -95,7 +97,8 @@ return nil." (let ((out (org-babel-read ref))) (if (equal out ref) (if (string-match "^\".+\"$" ref) - (read ref)) + (read ref) + :ob-must-be-reference) out))) (defvar org-babel-library-of-babel)