瀏覽代碼

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>
Nicolas Goaziou 3 年之前
父節點
當前提交
4198cbd074
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      lisp/org.el

+ 5 - 1
lisp/org.el

@@ -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)