named call lines insert results like code blocks
* lisp/ob-core.el (org-babel-find-named-result): Call lines are not results. (org-babel-where-is-src-block-result): Don't implicitly name the results of call lines. * lisp/ob-exp.el (org-babel-exp-non-block-elements): There is now another element on the call line info list. * lisp/ob-lob.el (org-babel-lob-get-info): Return the name (if any) at the end of the info list. (org-babel-lob-execute): Pass the name through to execution.
This commit is contained in:
parent
bf5f896bc2
commit
884f5ced13
|
@ -1717,7 +1717,8 @@ buffer or nil if no such result exists."
|
||||||
(when (and (string= "name" (downcase (match-string 1)))
|
(when (and (string= "name" (downcase (match-string 1)))
|
||||||
(or (beginning-of-line 1)
|
(or (beginning-of-line 1)
|
||||||
(looking-at org-babel-src-block-regexp)
|
(looking-at org-babel-src-block-regexp)
|
||||||
(looking-at org-babel-multi-line-header-regexp)))
|
(looking-at org-babel-multi-line-header-regexp)
|
||||||
|
(looking-at org-babel-lob-one-liner-regexp)))
|
||||||
(throw 'is-a-code-block (org-babel-find-named-result name (point))))
|
(throw 'is-a-code-block (org-babel-find-named-result name (point))))
|
||||||
(beginning-of-line 0) (point))))))
|
(beginning-of-line 0) (point))))))
|
||||||
|
|
||||||
|
@ -1822,10 +1823,7 @@ following the source block."
|
||||||
(looking-at org-babel-lob-one-liner-regexp)))
|
(looking-at org-babel-lob-one-liner-regexp)))
|
||||||
(inlinep (when (org-babel-get-inline-src-block-matches)
|
(inlinep (when (org-babel-get-inline-src-block-matches)
|
||||||
(match-end 0)))
|
(match-end 0)))
|
||||||
(name (if on-lob-line
|
(name (nth 4 (or info (org-babel-get-src-block-info 'light))))
|
||||||
(mapconcat #'identity (butlast (org-babel-lob-get-info))
|
|
||||||
"")
|
|
||||||
(nth 4 (or info (org-babel-get-src-block-info 'light)))))
|
|
||||||
(head (unless on-lob-line (org-babel-where-is-src-block-head)))
|
(head (unless on-lob-line (org-babel-where-is-src-block-head)))
|
||||||
found beg end)
|
found beg end)
|
||||||
(when head (goto-char head))
|
(when head (goto-char head))
|
||||||
|
|
|
@ -217,7 +217,7 @@ this template."
|
||||||
(concat
|
(concat
|
||||||
":var results="
|
":var results="
|
||||||
(mapconcat 'identity
|
(mapconcat 'identity
|
||||||
(butlast lob-info)
|
(butlast lob-info 2)
|
||||||
" ")))))))
|
" ")))))))
|
||||||
"" nil (car (last lob-info)))
|
"" nil (car (last lob-info)))
|
||||||
'lob))
|
'lob))
|
||||||
|
|
|
@ -114,12 +114,20 @@ if so then run the appropriate source block from the Library."
|
||||||
(or (funcall nonempty 8 19) ""))
|
(or (funcall nonempty 8 19) ""))
|
||||||
(funcall nonempty 9 18)))
|
(funcall nonempty 9 18)))
|
||||||
(list (length (if (= (length (match-string 12)) 0)
|
(list (length (if (= (length (match-string 12)) 0)
|
||||||
(match-string 2) (match-string 11)))))))))
|
(match-string 2) (match-string 11)))
|
||||||
|
(save-excursion
|
||||||
|
(forward-line -1)
|
||||||
|
(and (looking-at (concat org-babel-src-name-regexp
|
||||||
|
"\\([^\n]*\\)$"))
|
||||||
|
(org-no-properties (match-string 1))))))))))
|
||||||
|
|
||||||
(defvar org-babel-default-header-args:emacs-lisp) ; Defined in ob-emacs-lisp.el
|
(defvar org-babel-default-header-args:emacs-lisp) ; Defined in ob-emacs-lisp.el
|
||||||
(defun org-babel-lob-execute (info)
|
(defun org-babel-lob-execute (info)
|
||||||
"Execute the lob call specified by INFO."
|
"Execute the lob call specified by INFO."
|
||||||
(let* ((mkinfo (lambda (p) (list "emacs-lisp" "results" p nil nil (nth 2 info))))
|
(let* ((mkinfo (lambda (p)
|
||||||
|
(list "emacs-lisp" "results" p nil
|
||||||
|
(nth 3 info) ;; name
|
||||||
|
(nth 2 info))))
|
||||||
(pre-params (apply #'org-babel-merge-params
|
(pre-params (apply #'org-babel-merge-params
|
||||||
org-babel-default-header-args
|
org-babel-default-header-args
|
||||||
org-babel-default-header-args:emacs-lisp
|
org-babel-default-header-args:emacs-lisp
|
||||||
|
@ -130,7 +138,7 @@ if so then run the appropriate source block from the Library."
|
||||||
(org-no-properties
|
(org-no-properties
|
||||||
(concat
|
(concat
|
||||||
":var results="
|
":var results="
|
||||||
(mapconcat #'identity (butlast info)
|
(mapconcat #'identity (butlast info 2)
|
||||||
" "))))))))
|
" "))))))))
|
||||||
(pre-info (funcall mkinfo pre-params))
|
(pre-info (funcall mkinfo pre-params))
|
||||||
(cache-p (and (cdr (assoc :cache pre-params))
|
(cache-p (and (cdr (assoc :cache pre-params))
|
||||||
|
|
Loading…
Reference in New Issue