Sfoglia il codice sorgente

babel: Throw error on `org-babel-switch-to-session' when :session not in effect

    * ob.el (org-babel-switch-to-session): Throw error if block if
    :session not in effect for the block
Dan Davison 14 anni fa
parent
commit
ed62a85bf7
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. 2 0
      lisp/ob.el

+ 2 - 0
lisp/ob.el

@@ -450,6 +450,8 @@ of the source block to the kill ring."
 	   (or (and dir (file-name-as-directory dir)) default-directory))
 	 (cmd (intern (format "org-babel-%s-initiate-session" lang)))
 	 (cmd2 (intern (concat "org-babel-prep-session:" lang))))
+    (if (and (stringp session) (string= session "none"))
+	(error "This block is not using a session!"))
     (unless (fboundp cmd)
       (error "No org-babel-initiate-session function for %s!" lang))
     ;; copy body to the kill ring