Function: org-babel-exp--at-source

org-babel-exp--at-source is a macro defined in ob-exp.el.gz.

Signature

(org-babel-exp--at-source &rest BODY)

Documentation

Evaluate BODY at the source of the Babel block at point.

Source is located in org-babel-exp-reference-buffer. The value returned is the value of the last form in BODY. Assume that point is at the beginning of the Babel block.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ob-exp.el.gz
(defmacro org-babel-exp--at-source (&rest body)
  "Evaluate BODY at the source of the Babel block at point.
Source is located in `org-babel-exp-reference-buffer'.  The value
returned is the value of the last form in BODY.  Assume that
point is at the beginning of the Babel block."
  (declare (indent 1) (debug body))
  `(let ((source (get-text-property (point) 'org-reference)))
     ;; Source blocks created during export process (e.g., by other
     ;; source blocks) are not referenced.  In this case, do not move
     ;; point at all.
     (with-current-buffer (if source org-babel-exp-reference-buffer
			    (current-buffer))
       (org-with-wide-buffer
	(when source (goto-char source))
	,@body))))