瀏覽代碼

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.
Bastien Guerry 13 年之前
父節點
當前提交
7b6171735f
共有 1 個文件被更改,包括 6 次插入3 次删除
  1. 6 3
      lisp/ob.el

+ 6 - 3
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? "