From: ~johnmuhl <johnmuhl@git.sr.ht>
To: 65673@debbugs.gnu.org
Cc: ~emacs/emacs-devel@lists.sr.ht
Subject: bug#65673: [PATCH emacs 0/1] Add lua-ts-mode
Date: Thu, 31 Aug 2023 22:55:38 +0000 [thread overview]
Message-ID: <169352253839.28940.16024479871485106701-0@git.sr.ht> (raw)
This email and patch were generated and sent using the web based
“Prepare a patchset” feature of Sourcehut. I hope it will be a useful
POC for how Emacs could integrate a forge based pull request style
workflow for occasional contributors with (hopefully) minimal hassle
for those with push access. If it causes too much annoyance I’m happy
to resend it the preferred way.
I’ve also CC’d a Sourcehut mailing list to test the patch review
feature so if this experiment continues it’d be good if we could keep
“~emacs/emacs-devel@lists.sr.ht” included in any replies. Other than
that just do the usual patch review/handling.
The sr.ht hosted version of the Sourcehut forge is considered “Good
enough to recommend” by the GNU Ethical Repository Criteria in case
anyone wonders about that.
https://www.gnu.org/software/repo-criteria-evaluation.html
Discussion or questions about Sourcehut or the workflow should
probably go somewhere else but please CC me in that case.
Thanks.
////
This patch adds a lua-ts-mode for editing Lua files in Emacs >= 29.1.
It is comparable in features to the NonGNU ELPA lua-mode. Shortcomings
in the partially supported features are mentioned below.
| Feature | lua-mode | lua-ts-mode |
|------------------------+----------+-------------|
| indentation ¹ | Yes | Yes |
| highlighting | Yes | Yes |
| documentation lookup ² | Yes | Yes |
| imenu support ³ | Yes | Partial |
| hideshow support | Yes | Yes |
| outline support | No | Yes |
| flymake support ⁴ | Yes | Yes |
| which-func support | No | Yes |
| inferior Lua ⁵ | Yes | Partial |
1. Indentation tries to follow the default EmmyLua style. This is the
same formatter used by lua-ls so out of the box eglot-format and
automatic indentation should agree about indents.
2. Both modes implement this feature by calling browse-url for the
manual.html file that is normally distributed with Lua. lua-mode
has a fallback that uses an online version, lua-ts-mode has no
fallback but works with the online docs if customized.
3. I tried to follow the model used in other ts modes but it doesn’t
seem like the results are very useful compared to Eglot/lua-ls. I’d
like it to improve eventually but it’s low priority personally and
wouldn’t oppose removing it for now.
4. Both modes require the Luacheck program to be installed.
5. The comint integration is the most basic. lua-mode supports things
like "Send {buffer,region} to process" which I’d like to add but
haven’t had time. Currently lua-ts-mode only supports starting an
inferior Lua process and interacting with it directly.
The patch file is also available from:
https://git.sr.ht/~johnmuhl/emacs/commit/391699e.patch
Thanks again.
john muhl (1):
Add lua-ts-mode
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
--
2.38.5
next reply other threads:[~2023-08-31 22:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-31 22:55 ~johnmuhl [this message]
2023-08-31 21:32 ` bug#65672: [PATCH emacs 1/1] Add lua-ts-mode ~johnmuhl
2023-09-02 12:14 ` bug#65673: [PATCH emacs 0/1] " Philip Kaludercic
2023-09-02 14:10 ` bug#65672: [PATCH emacs 1/1] " Augusto Stoffel
[not found] ` <handler.65672.B.169354983214451.ack@debbugs.gnu.org>
2023-09-04 14:36 ` john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-04 15:18 ` Eli Zaretskii
2023-09-04 15:54 ` Philip Kaludercic
2023-09-01 22:46 ` bug#65673: [PATCH emacs 0/1] " Mauro Aranda
2023-09-09 15:17 ` bug#65673: [PATCH emacs 1/1 v2] " john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-09 15:17 ` bug#65673: [PATCH] " john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-10 11:12 ` Philip Kaludercic
2023-09-10 12:57 ` Augusto Stoffel
2023-09-11 15:03 ` john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-16 10:03 ` Eli Zaretskii
2023-09-16 11:17 ` Eli Zaretskii
2023-09-16 11:21 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=169352253839.28940.16024479871485106701-0@git.sr.ht \
--to=johnmuhl@git.sr.ht \
--cc=65673@debbugs.gnu.org \
--cc=jm@pub.pink \
--cc=~emacs/emacs-devel@lists.sr.ht \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.