unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#74951: [PATCH] Add 'lua-ts-mode' to 'interpreter-mode-alist'
@ 2024-12-18 19:17 john muhl
  2024-12-18 19:20 ` john muhl
  0 siblings, 1 reply; 2+ messages in thread
From: john muhl @ 2024-12-18 19:17 UTC (permalink / raw)
  To: 74951

Tags: patch

Make is so that extensionless Lua scripts get recognized based on
the interpreter line.





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#74951: [PATCH] Add 'lua-ts-mode' to 'interpreter-mode-alist'
  2024-12-18 19:17 bug#74951: [PATCH] Add 'lua-ts-mode' to 'interpreter-mode-alist' john muhl
@ 2024-12-18 19:20 ` john muhl
  0 siblings, 0 replies; 2+ messages in thread
From: john muhl @ 2024-12-18 19:20 UTC (permalink / raw)
  To: 74951

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-Add-lua-ts-mode-to-interpreter-mode-alist.patch --]
[-- Type: text/x-patch, Size: 960 bytes --]

From 375f901d152b929d7f64bd2c18fa6a02bd4ba233 Mon Sep 17 00:00:00 2001
From: john muhl <jm@pub.pink>
Date: Wed, 18 Dec 2024 10:59:19 -0600
Subject: [PATCH] Add 'lua-ts-mode' to 'interpreter-mode-alist'

* 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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el
index 9d2969d6ac4..6fa3e51b34b 100644
--- a/lisp/progmodes/lua-ts-mode.el
+++ b/lisp/progmodes/lua-ts-mode.el
@@ -839,7 +839,8 @@ lua-ts-mode
 (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)
 
-- 
2.47.1


[-- Attachment #2: Type: text/plain, Size: 143 bytes --]



john muhl <jm@pub.pink> writes:

> Tags: patch
>
> Make is so that extensionless Lua scripts get recognized based on
> the interpreter line.

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-18 19:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-18 19:17 bug#74951: [PATCH] Add 'lua-ts-mode' to 'interpreter-mode-alist' john muhl
2024-12-18 19:20 ` john muhl

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).