diff --git a/lisp/ob-core.el b/lisp/ob-core.el index c3b1333bb..74796e5b7 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -536,8 +536,12 @@ can not be resolved.") ;;; functions (defvar call-process-region) -(defvar org-babel-current-exec-src-block-head nil - "Marker to the currently processed src block.") +(defvar org-babel-current-src-block-location nil + "Marker pointing to the src block currently being executed. +This may also point to a call line or an inline code block. If +multiple blocks are being executed (e.g., in chained execution +through use of the :var header argument) this marker points to +the outer-most code block.") ;;;###autoload (defun org-babel-execute-src-block (&optional arg info params) @@ -565,8 +569,8 @@ block." (let* ((params (if params (org-babel-process-params merged-params) (nth 2 info))) - (org-babel-current-exec-src-block-head - (or org-babel-current-exec-src-block-head (nth 6 info))) + (org-babel-current-src-block-location + (or org-babel-current-src-block-location (nth 6 info))) (cachep (and (not arg) (cdr (assoc :cache params)) (string= "yes" (cdr (assoc :cache params))))) (new-hash (when cachep (org-babel-sha1-hash info))) diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el index 2dcc739c8..7b3e04a43 100644 --- a/lisp/ob-exp.el +++ b/lisp/ob-exp.el @@ -388,7 +388,7 @@ inhibit insertion of results into the buffer." info (org-babel-exp-get-export-buffer)) (nth 1 info))) (info (copy-sequence info)) - (org-babel-current-exec-src-block-head (point-marker))) + (org-babel-current-src-block-location (point-marker))) ;; skip code blocks which we can't evaluate (when (fboundp (intern (concat "org-babel-execute:" lang))) (org-babel-eval-wipe-error-buffer) diff --git a/lisp/ob-lob.el b/lisp/ob-lob.el index 91947f781..a1a65f8ac 100644 --- a/lisp/ob-lob.el +++ b/lisp/ob-lob.el @@ -133,7 +133,7 @@ if so then run the appropriate source block from the Library." (string= "yes" (cdr (assoc :cache pre-params))))) (new-hash (when cache-p (org-babel-sha1-hash pre-info))) (old-hash (when cache-p (org-babel-current-result-hash))) - (org-babel-current-exec-src-block-head (point-marker))) + (org-babel-current-src-block-location (point-marker))) (if (and cache-p (equal new-hash old-hash)) (save-excursion (goto-char (org-babel-where-is-src-block-result)) (forward-line 1)