Преглед изворни кода

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? "