mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-25 08:32:53 +00:00
lisp/org-lint.el (org-lint-named-result): Improve accuracy and message
Reported-by: gerard.vermeulen@posteo.net Link: https://orgmode.org/list/b3dc0bd4368f3db0c7afe136d9f9ca97@posteo.net
This commit is contained in:
parent
228d6ccfcf
commit
d2986be076
|
@ -1362,10 +1362,17 @@ Use \"export %s\" instead"
|
|||
(defun org-lint-named-result (ast)
|
||||
(org-element-map ast org-element-all-elements
|
||||
(lambda (el)
|
||||
(when (and (org-element-property :results el)
|
||||
(org-element-property :name el))
|
||||
(list (org-element-begin el)
|
||||
"#+name: in results of evaluation will be replaced by re-evaluating the src block. Use #+name in the block instead.")))))
|
||||
(when-let* ((result (org-element-property :results el))
|
||||
(result-name (org-element-property :name el))
|
||||
(origin-block
|
||||
(if (org-string-nw-p (car result))
|
||||
(condition-case _
|
||||
(org-export-resolve-link (car result) `(:parse-tree ,ast))
|
||||
(org-link-broken nil))
|
||||
(org-export-get-previous-element el nil))))
|
||||
(when (org-element-type-p origin-block 'src-block)
|
||||
(list (org-element-begin el)
|
||||
(format "Links to \"%s\" will not be valid during export unless the parent source block has :exports results or both" result-name)))))))
|
||||
|
||||
(defun org-lint-spurious-colons (ast)
|
||||
(org-element-map ast '(headline inlinetask)
|
||||
|
|
Loading…
Reference in a new issue