]> git.eshelyaron.com Git - emacs.git/commitdiff
Add 'lua-ts-mode' to 'interpreter-mode-alist'
authorjohn muhl <jm@pub.pink>
Wed, 18 Dec 2024 16:59:19 +0000 (10:59 -0600)
committerEshel Yaron <me@eshelyaron.com>
Mon, 23 Dec 2024 15:19:48 +0000 (16:19 +0100)
* lisp/progmodes/lua-ts-mode.el: Enable 'lua-ts-mode' for Lua
scripts based on their interpreter line.  (Bug#74951)

(cherry picked from commit 08b62132ddee01f0c84bc478b718370b51fade6a)

lisp/progmodes/lua-ts-mode.el

index 9d2969d6ac443e629acdca5467ee0d15c0101774..6fa3e51b34b25454898fa39431325dd8b2316d15 100644 (file)
@@ -839,7 +839,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)