Add 'lua-ts-mode' to 'interpreter-mode-alist'
authorjohn muhl <jm@pub.pink>
Wed, 18 Dec 2024 16:59:19 +0000 (10:59 -0600)
committerEli Zaretskii <eliz@gnu.org>
Sat, 21 Dec 2024 10:53:21 +0000 (12:53 +0200)
* lisp/progmodes/lua-ts-mode.el: Enable 'lua-ts-mode' for Lua
scripts based on their interpreter line.  (Bug#74951)

lisp/progmodes/lua-ts-mode.el

index 9d06517a97d5134153f259e176c818099707ebbe..641ea4261b0130ef415fda3906193c16e45f8e64 100644 (file)
@@ -853,7 +853,8 @@ Calls REPORT-FN directly."
 (derived-mode-add-parents 'lua-ts-mode '(lua-mode))
 
 (when (treesit-ready-p 'lua)
-  (add-to-list 'auto-mode-alist '("\\.lua\\'" . lua-ts-mode)))
+  (add-to-list 'auto-mode-alist '("\\.lua\\'" . lua-ts-mode))
+  (add-to-list 'interpreter-mode-alist '("\\<lua\\(?:jit\\)?" . lua-ts-mode)))
 
 (provide 'lua-ts-mode)