Browse Source

babel: more careful not to evaluate code blocks without sessions on export

* contrib/babel/lisp/org-babel-exp.el (org-babel-exp-do-export): now
  explicitly checking if session is equal to "none" on export
Eric Schulte 15 years ago
parent
commit
ac2e6fefee
1 changed files with 3 additions and 2 deletions
  1. 3 2
      contrib/babel/lisp/org-babel-exp.el

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

@@ -121,8 +121,9 @@ options are taken from `org-babel-default-header-args'."
 (defun org-babel-exp-do-export (info type)
   "Return a string containing the exported content of the current
 code block respecting the value of the :exports header argument."
-  (flet ((silently () (when (cdr (assoc :session (third info)))
-			(org-babel-exp-results info type 'silent)))
+  (flet ((silently () (let ((session (cdr (assoc :session (third info)))))
+			(when (and session (not (equal "none" session)))
+			  (org-babel-exp-results info type 'silent))))
 	 (clean () (org-babel-remove-result info)))
     (case (intern (or (cdr (assoc :exports (third info))) "code"))
       ('none (silently) (clean) "")