Strictly match language when loading Elisp code

* lisp/org.el (org-babel-load-file): Strictly check language before
loading source code.

Reported-by: dmg <dmg@turingmachine.org>
<http://lists.gnu.org/r/emacs-orgmode/2021-07/msg00631.html>
This commit is contained in:
Nicolas Goaziou 2021-08-07 22:22:05 +02:00
parent a43d7a575d
commit 4198cbd074
1 changed files with 5 additions and 1 deletions

View File

@ -232,7 +232,11 @@ byte-compiled before it is loaded."
tangled-file
(file-attribute-modification-time
(file-attributes (file-truename file))))
(org-babel-tangle-file file tangled-file "emacs-lisp\\|elisp"))
(org-babel-tangle-file file
tangled-file
(rx string-start
(or "emacs-lisp" "elisp")
string-end)))
(if compile
(progn
(byte-compile-file tangled-file)