Function: org-babel-load-in-session

org-babel-load-in-session is an autoloaded, interactive and byte-compiled function defined in ob-core.el.gz.

Signature

(org-babel-load-in-session &optional ARG INFO)

Documentation

Load the body of the current source-code block.

When optional argument INFO is non-nil, use source block defined in INFO, as returned by org-babel-get-src-block-info.

Evaluate the header arguments for the source block before entering the session. After loading the body this pops open the session.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/org/ob-core.el.gz
;;;###autoload
(defun org-babel-load-in-session (&optional _arg info)
  "Load the body of the current source-code block.
When optional argument INFO is non-nil, use source block defined in
INFO, as returned by `org-babel-get-src-block-info'.

Evaluate the header arguments for the source block before
entering the session.  After loading the body this pops open the
session."
  (interactive)
  (let* ((info (or info (org-babel-get-src-block-info)))
         (lang (nth 0 info))
         (params (nth 2 info))
         (body (if (not info)
		   (user-error "No src code block at point")
		 (setf (nth 1 info)
		       (if (org-babel-noweb-p params :eval)
			   (org-babel-expand-noweb-references info)
			 (nth 1 info)))))
         (session (cdr (assq :session params)))
	 (dir (cdr (assq :dir params)))
	 (default-directory
	   (or (and dir (file-name-as-directory dir)) default-directory))
	 (cmd (intern (concat "org-babel-load-session:" lang))))
    (unless (fboundp cmd)
      (error "No org-babel-load-session function for %s!" lang))
    (pop-to-buffer (funcall cmd session body params))
    (end-of-line 1)))