ob-ref: fix bug
* lisp/ob-ref.el (org-babel-ref-resolve): Fix error when src block result is nil.
This commit is contained in:
parent
3f6e71e62e
commit
f0380f54c1
|
@ -162,11 +162,9 @@ the variable."
|
|||
(goto-char (point-min))
|
||||
(let* ((params (append args '((:results . "silent"))))
|
||||
(regexp (org-babel-named-data-regexp-for-name ref))
|
||||
lob-info
|
||||
(result
|
||||
(cond
|
||||
(catch :found
|
||||
;; Check for code blocks or named data.
|
||||
((catch :found
|
||||
(while (re-search-forward regexp nil t)
|
||||
;; Ignore COMMENTed headings and orphaned
|
||||
;; affiliated keywords.
|
||||
|
@ -191,14 +189,13 @@ the variable."
|
|||
(guard v))
|
||||
(throw :found v))
|
||||
(_ (error "Reference not found")))))))
|
||||
nil))
|
||||
;; Check for local or global headlines by ID.
|
||||
((org-babel-ref-goto-headline-id ref)
|
||||
(org-babel-ref-headline-body))
|
||||
(when (org-babel-ref-goto-headline-id ref)
|
||||
(throw :found (org-babel-ref-headline-body)))
|
||||
;; Check the Library of Babel.
|
||||
((setq lob-info
|
||||
(cdr (assq (intern ref) org-babel-library-of-babel)))
|
||||
(org-babel-execute-src-block nil lob-info params))
|
||||
(let ((lob-info (cdr (assq (intern ref) org-babel-library-of-babel))))
|
||||
(when lob-info
|
||||
(throw :found (org-babel-execute-src-block nil lob-info params))))
|
||||
(t (error "Reference `%s' not found in this buffer" ref)))))
|
||||
(cond
|
||||
((symbolp result) (format "%S" result))
|
||||
|
|
Loading…
Reference in New Issue