From 1877652ce0234cf333fa103b5ada08fbf5946ab1 Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Wed, 13 Nov 2013 11:42:40 -0700 Subject: [PATCH] allow reference to named call lines * lisp/ob-ref.el (org-babel-ref-resolve): Look for call lines when resolving references. --- lisp/ob-ref.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lisp/ob-ref.el b/lisp/ob-ref.el index 251fa557a..b8ee9f82b 100644 --- a/lisp/ob-ref.el +++ b/lisp/ob-ref.el @@ -186,6 +186,11 @@ the variable." (or (looking-at org-babel-src-block-regexp) (looking-at org-babel-multi-line-header-regexp)))) (setq type 'source-block)) + ((and (looking-at org-babel-src-name-regexp) + (save-excursion + (forward-line 1) + (looking-at org-babel-lob-one-liner-regexp))) + (setq type 'call-line)) (t (while (not (setq type (org-babel-ref-at-ref-p))) (forward-line 1) (beginning-of-line) @@ -201,6 +206,10 @@ the variable." (source-block (org-babel-execute-src-block nil nil (if org-babel-update-intermediate nil params))) + (call-line (save-excursion + (forward-line 1) + (org-babel-lob-execute + (org-babel-lob-get-info)))) (lob (org-babel-execute-src-block nil lob-info params)) (id (org-babel-ref-headline-body)))))