1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-21 06:55:35 +00:00

org-lint: Improve heuristics for unknown src block language

* lisp/org-lint.el (org-lint-suspicious-language-in-src-block): Do not
complain about src block languages without execute function if there
is <lang>-mode major mode available.

Reported-by: Suhail Singh <suhailsingh247@gmail.com>
Link: https://orgmode.org/list/874ja7ik7h.fsf@gmail.com
This commit is contained in:
Ihor Radchenko 2024-06-05 17:08:50 +02:00
parent 04d56f757f
commit 51aea49462
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B

View File

@ -542,7 +542,10 @@ Use :header-args: instead"
(org-element-map ast 'src-block
(lambda (b)
(when-let ((lang (org-element-property :language b)))
(unless (functionp (intern (format "org-babel-execute:%s" lang)))
(unless (or (functionp (intern (format "org-babel-execute:%s" lang)))
;; No babel backend, but there is corresponding
;; major mode.
(fboundp (org-src-get-lang-mode lang)))
(list (org-element-property :post-affiliated b)
(format "Unknown source block language: '%s'" lang)))))))