Browse Source

allow reference to named call lines

* lisp/ob-ref.el (org-babel-ref-resolve): Look for call lines when
  resolving references.
Eric Schulte 7 years ago
parent
commit
1877652ce0
1 changed files with 9 additions and 0 deletions
  1. 9 0
      lisp/ob-ref.el

+ 9 - 0
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)))))