From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#65673: [PATCH emacs 0/1] Add lua-ts-mode Date: Sat, 02 Sep 2023 12:14:26 +0000 Message-ID: <8734zwg4bh.fsf@posteo.net> References: <169352253839.28940.16024479871485106701-1@git.sr.ht> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22146"; mail-complaints-to="usenet@ciao.gmane.io" Cc: ~johnmuhl , ~emacs/emacs-devel@lists.sr.ht, 65673@debbugs.gnu.org, 65672@debbugs.gnu.org To: ~johnmuhl Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 02 14:15:26 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qcPXB-0005XO-SR for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Sep 2023 14:15:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qcPWh-0004i3-AF; Sat, 02 Sep 2023 08:14:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qcPWf-0004hS-PF for bug-gnu-emacs@gnu.org; Sat, 02 Sep 2023 08:14:53 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qcPWf-0001EM-H7 for bug-gnu-emacs@gnu.org; Sat, 02 Sep 2023 08:14:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qcPWp-0005Vq-7O for bug-gnu-emacs@gnu.org; Sat, 02 Sep 2023 08:15:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Sep 2023 12:15:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65673 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65673-submit@debbugs.gnu.org id=B65673.169365688921131 (code B ref 65673); Sat, 02 Sep 2023 12:15:03 +0000 Original-Received: (at 65673) by debbugs.gnu.org; 2 Sep 2023 12:14:49 +0000 Original-Received: from localhost ([127.0.0.1]:35382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcPWZ-0005Uj-Gc for submit@debbugs.gnu.org; Sat, 02 Sep 2023 08:14:48 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:36535) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcPWV-0005UP-IG for 65673@debbugs.gnu.org; Sat, 02 Sep 2023 08:14:46 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id E9E57240029 for <65673@debbugs.gnu.org>; Sat, 2 Sep 2023 14:14:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1693656868; bh=8sKC9PoONH+8LEA1EkBNqQbI4NFmnclq1rECmPeofFg=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=lEfcd15lJsX9lBi77cGxNjeSFPj96TsyDm+u5UhfEG3IW8CCdL63PwrXwdksv1kJl QxZZ/1f66RlY6UP5MhXGdswhlGJNf23KpPk+YhQK4TPA7cPl1kzuIPqCvj2Cti9FA6 RJGRKzxNIWuPpMsSS0Ih2AUHca7TfNrlV67Kl9PqHxwqPMiXtdKlQWEgDzIAd7hxxG tgFS+p96ogkLOwKTZN+fO8WgO5O1vT48pnn1+mxI1OZFy20X0tdG7XmXxsZTJZgokZ EWqxEz3VrfXMoqL797k9WqiIijiIL1iEujQRNt0HAyoMLZyk/OSQkd449DLQUibOCR LkzLal4mY9kFA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RdDNL68FNz9rxH; Sat, 2 Sep 2023 14:14:26 +0200 (CEST) In-Reply-To: <169352253839.28940.16024479871485106701-1@git.sr.ht> (johnmuhl@git.sr.ht's message of "Thu, 31 Aug 2023 16:32:06 -0500") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:268989 Archived-At: ~johnmuhl writes: > From: john muhl > > * test/lisp/progmodes/lua-ts-mode-tests.el: > * test/lisp/progmodes/lua-ts-mode-resources/indent.ert: > * lisp/progmodes/lua-ts-mode.el: New file. > * lisp/progmodes/eglot.el (eglot-server-programs): > * lisp/progmodes/hideshow.el (hs-special-modes-alist): > Add support for lua-ts-mode. > * admin/notes/tree-sitter/build-module/batch.sh: > * admin/notes/tree-sitter/build-module/build.sh: Add Lua grammar. > * test/infra/Dockerfile.emba: > * test/infra/test-jobs.yml: Add lua-ts-mode tests. > --- > admin/notes/tree-sitter/build-module/batch.sh | 1 + > admin/notes/tree-sitter/build-module/build.sh | 3 + > etc/NEWS | 4 + > lisp/progmodes/eglot.el | 2 +- > lisp/progmodes/hideshow.el | 1 + > lisp/progmodes/lua-ts-mode.el | 457 ++++++++++++++++++ > test/infra/Dockerfile.emba | 1 + > test/infra/test-jobs.yml | 1 + > .../lua-ts-mode-resources/indent.erts | 152 ++++++ > test/lisp/progmodes/lua-ts-mode-tests.el | 32 ++ > 10 files changed, 653 insertions(+), 1 deletion(-) > create mode 100644 lisp/progmodes/lua-ts-mode.el > create mode 100644 test/lisp/progmodes/lua-ts-mode-resources/indent.erts > create mode 100644 test/lisp/progmodes/lua-ts-mode-tests.el > > diff --git a/admin/notes/tree-sitter/build-module/batch.sh b/admin/notes/tree-sitter/build-module/batch.sh > index 1d4076564dc..685a35c269d 100755 > --- a/admin/notes/tree-sitter/build-module/batch.sh > +++ b/admin/notes/tree-sitter/build-module/batch.sh > @@ -15,6 +15,7 @@ languages=( > 'html' > 'javascript' > 'json' > + 'lua' > 'python' > 'rust' > 'toml' > diff --git a/admin/notes/tree-sitter/build-module/build.sh b/admin/notes/tree-sitter/build-module/build.sh > index 0832875168b..969187b7f92 100755 > --- a/admin/notes/tree-sitter/build-module/build.sh > +++ b/admin/notes/tree-sitter/build-module/build.sh > @@ -42,6 +42,9 @@ case "${lang}" in > "heex") > org="phoenixframework" > ;; > + "lua") > + org="MunifTanjim" > + ;; > "typescript") > sourcedir="tree-sitter-typescript/typescript/src" > grammardir="tree-sitter-typescript/typescript" > diff --git a/etc/NEWS b/etc/NEWS > index 9a98db8c83a..1a40a62615b 100644 > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -730,6 +730,10 @@ A major mode based on the tree-sitter library for editing HEEx files. > A major mode based on the tree-sitter library for editing Elixir > files. > > +--- > +*** New major mode 'lua-ts-mode'. > +A major mode based on the tree-sitter library for editing Lua files. > + > --- > ** The highly accessible Modus themes collection has eight items. > The 'modus-operandi' and 'modus-vivendi' are the main themes that have > diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el > index 65daa0941d5..f249e3c81b4 100644 > --- a/lisp/progmodes/eglot.el > +++ b/lisp/progmodes/eglot.el > @@ -237,7 +237,7 @@ chosen (interactively or automatically)." > (gdscript-mode . ("localhost" 6008)) > ((fortran-mode f90-mode) . ("fortls")) > (futhark-mode . ("futhark" "lsp")) > - (lua-mode . ,(eglot-alternatives > + ((lua-mode lua-ts-mode) . ,(eglot-alternatives > '("lua-language-server" "lua-lsp"))) > (zig-mode . ("zls")) > ((css-mode css-ts-mode) > diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el > index b878986d7a4..78e39fad740 100644 > --- a/lisp/progmodes/hideshow.el > +++ b/lisp/progmodes/hideshow.el > @@ -264,6 +264,7 @@ This has effect only if `search-invisible' is set to `open'." > (java-ts-mode "{" "}" "/[*/]" nil nil) > (js-mode "{" "}" "/[*/]" nil) > (js-ts-mode "{" "}" "/[*/]" nil) > + (lua-ts-mode "{\\|\\[\\[" "}\\|\\]\\]" "--" nil) > (mhtml-mode "{\\|<[^/>]*?" "}\\|]*[^/]>" "