allow reference to named call lines

* lisp/ob-ref.el (org-babel-ref-resolve): Look for call lines when
  resolving references.
This commit is contained in:
Eric Schulte 2013-11-13 11:42:40 -07:00
parent b6448c4225
commit 1877652ce0
1 changed files with 9 additions and 0 deletions

View File

@ -186,6 +186,11 @@ the variable."
(or (looking-at org-babel-src-block-regexp) (or (looking-at org-babel-src-block-regexp)
(looking-at org-babel-multi-line-header-regexp)))) (looking-at org-babel-multi-line-header-regexp))))
(setq type 'source-block)) (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))) (t (while (not (setq type (org-babel-ref-at-ref-p)))
(forward-line 1) (forward-line 1)
(beginning-of-line) (beginning-of-line)
@ -201,6 +206,10 @@ the variable."
(source-block (org-babel-execute-src-block (source-block (org-babel-execute-src-block
nil nil (if org-babel-update-intermediate nil nil (if org-babel-update-intermediate
nil params))) nil params)))
(call-line (save-excursion
(forward-line 1)
(org-babel-lob-execute
(org-babel-lob-get-info))))
(lob (org-babel-execute-src-block (lob (org-babel-execute-src-block
nil lob-info params)) nil lob-info params))
(id (org-babel-ref-headline-body))))) (id (org-babel-ref-headline-body)))))