all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: john muhl via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Dmitry Gutov <dmitry@gutov.dev>
Cc: 69088@debbugs.gnu.org
Subject: bug#69088: [PATCH] Eagerly indent first field in tables in lua-ts-mode
Date: Mon, 12 Feb 2024 21:42:01 -0600	[thread overview]
Message-ID: <87eddhqb6o.fsf@pub.pink> (raw)
In-Reply-To: <2ec322a0-e772-4191-b416-e9bf49a6d4e6@gutov.dev>

[-- Attachment #1: Type: text/plain, Size: 352 bytes --]

Dmitry Gutov <dmitry@gutov.dev> writes:

> On 13/02/2024 04:49, john muhl via Bug reports for GNU Emacs, the
> Swiss army knife of text editors wrote:
>> +     ((and (lambda (node &rest _) (null node))
>> +           (parent-is "table_constructor"))
>
> That's probably the same as (match null "table_constructor")

Yes it is. Thanks for the pointer.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Eagerly-indent-first-field-in-tables-in-lua-ts-mode.patch --]
[-- Type: text/x-patch, Size: 1069 bytes --]

From 2ccb8aaff8c08f1cb55f66c4b556c1f8aedc4d9e Mon Sep 17 00:00:00 2001
From: john muhl <jm@pub.pink>
Date: Mon, 12 Feb 2024 18:46:51 -0600
Subject: [PATCH] Eagerly indent first field in tables in lua-ts-mode

* lisp/progmodes/lua-ts-mode.el (lua-ts--simple-indent-rules):
Properly indent the first field of a table when it appears on a
line by itself.  (bug#69088)
---
 lisp/progmodes/lua-ts-mode.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el
index dc2a8fcec1e..c7f5ac50b04 100644
--- a/lisp/progmodes/lua-ts-mode.el
+++ b/lisp/progmodes/lua-ts-mode.el
@@ -317,6 +317,8 @@ lua-ts--simple-indent-rules
           (node-is ")")
           (node-is "}"))
       standalone-parent 0)
+     ((match null "table_constructor")
+      standalone-parent lua-ts-indent-offset)
      ((or (and (parent-is "arguments") lua-ts--first-child-matcher)
           (and (parent-is "parameters") lua-ts--first-child-matcher)
           (and (parent-is "table_constructor") lua-ts--first-child-matcher))
-- 
2.41.0


  reply	other threads:[~2024-02-13  3:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-13  1:00 bug#69088: [PATCH] Eagerly indent first field in tables in lua-ts-mode john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found] ` <handler.69088.B.170779128814939.ack@debbugs.gnu.org>
2024-02-13  2:49   ` john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-13  3:21     ` Dmitry Gutov
2024-02-13  3:42       ` john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-02-17  8:58         ` 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=87eddhqb6o.fsf@pub.pink \
    --to=bug-gnu-emacs@gnu.org \
    --cc=69088@debbugs.gnu.org \
    --cc=dmitry@gutov.dev \
    --cc=jm@pub.pink \
    /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.