From 7b6171735ff3019b58ab82ad382d44b1d226dc39 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Tue, 10 Jul 2012 22:07:43 +0200 Subject: [PATCH] Prevent errors when `org-current-export-file' is void. * ob.el (org-babel-confirm-evaluate): Prevent errors when `org-current-export-file' is void. Thanks to John Wiegley for reporting this. --- lisp/ob.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/ob.el b/lisp/ob.el index 1bd5eb4e6..a2b02ee4a 100644 --- a/lisp/ob.el +++ b/lisp/ob.el @@ -285,15 +285,18 @@ of potentially harmful code." (let* ((eval (or (cdr (assoc :eval (nth 2 info))) (when (assoc :noeval (nth 2 info)) "no"))) (query (cond ((equal eval "query") t) - ((and org-current-export-file + ((and (boundp 'org-current-export-file) + org-current-export-file (equal eval "query-export")) t) ((functionp org-confirm-babel-evaluate) (funcall org-confirm-babel-evaluate (nth 0 info) (nth 1 info))) (t org-confirm-babel-evaluate)))) (if (or (equal eval "never") (equal eval "no") - (and org-current-export-file (or (equal eval "no-export") - (equal eval "never-export"))) + (and (boundp 'org-current-export-file) + org-current-export-file + (or (equal eval "no-export") + (equal eval "never-export"))) (and query (not (yes-or-no-p (format "Evaluate this%scode block%son your system? " -- 2.11.4.GIT