diff options
| author | Ihor Radchenko <yantar92@posteo.net> | 2023-12-24 12:35:00 +0100 |
|---|---|---|
| committer | Ihor Radchenko <yantar92@posteo.net> | 2023-12-24 12:35:34 +0100 |
| commit | b8b02e3da3398ed992e0492946652fd6de1a29ac (patch) | |
| tree | 8fcb2222ae4438950186e15721a5dc83806670a0 | |
| parent | 52a836b40d86115153e469a9e1af3947428ebd3f (diff) | |
| download | org-mode-b8b02e3da.tar.gz | |
org-lint: New linter for named results of evaluation
* lisp/org-lint.el (org-lint-named-result):
(named-result):
Link: https://orgmode.org/list/87ilpj9lv1.fsf@localhost
| -rw-r--r-- | lisp/org-lint.el | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lisp/org-lint.el b/lisp/org-lint.el index 1ef114e..64efa17 100644 --- a/lisp/org-lint.el +++ b/lisp/org-lint.el @@ -1346,6 +1346,14 @@ Use \"export %s\" instead" reports)))))))))))) reports)) +(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."))))) + (defun org-lint-spurious-colons (ast) (org-element-map ast '(headline inlinetask) (lambda (h) @@ -1553,6 +1561,11 @@ AST is the buffer parse tree." #'org-lint-wrong-header-value :categories '(babel) :trust 'low) +(org-lint-add-checker 'named-result + "Report results evaluation with #+name keyword." + #'org-lint-named-result + :categories '(babel) :trust 'high) + (org-lint-add-checker 'empty-header-argument "Report empty values in babel headers" #'org-lint-empty-header-argument |
