Function: org-babel-lob-get-info

org-babel-lob-get-info is an autoloaded and byte-compiled function defined in ob-lob.el.gz.

Signature

(org-babel-lob-get-info &optional DATUM NO-EVAL)

Documentation

Return internal representation for Library of Babel function call.

Consider DATUM, when provided, or element at point otherwise.

When optional argument NO-EVAL is non-nil, Babel does not resolve remote variable references; a process which could likely result in the execution of other code blocks, and do not evaluate Lisp values in parameters.

Return nil when not on an appropriate location. Otherwise return a list compatible with org-babel-get-src-block-info, which see.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ob-lob.el.gz
;;;###autoload
(defun org-babel-lob-get-info (&optional datum no-eval)
  "Return internal representation for Library of Babel function call.

Consider DATUM, when provided, or element at point otherwise.

When optional argument NO-EVAL is non-nil, Babel does not resolve
remote variable references; a process which could likely result
in the execution of other code blocks, and do not evaluate Lisp
values in parameters.

Return nil when not on an appropriate location.  Otherwise return
a list compatible with `org-babel-get-src-block-info', which
see."
  (let* ((context (or datum (org-element-context)))
	 (type (org-element-type context))
	 (reference (org-element-property :call context)))
    (when (memq type '(babel-call inline-babel-call))
      (pcase (org-babel-lob--src-info reference)
	(`(,language ,body ,header ,_ ,_ ,_ ,coderef)
	 (let ((begin (org-element-property (if (eq type 'inline-babel-call)
						:begin
					      :post-affiliated)
					    context)))
	   (list language
		 body
		 (apply #'org-babel-merge-params
			header
			org-babel-default-lob-header-args
			(append
			 (org-with-point-at begin
			   (org-babel-params-from-properties language no-eval))
			 (list
			  (org-babel-parse-header-arguments
			   (org-element-property :inside-header context) no-eval)
			  (let ((args (org-element-property :arguments context)))
			    (and args
				 (mapcar (lambda (ref) (cons :var ref))
					 (org-babel-ref-split-args args))))
			  (org-babel-parse-header-arguments
			   (org-element-property :end-header context) no-eval))))
		 nil
		 (org-element-property :name context)
		 begin
		 coderef)))
	(_ nil)))))