Subject: bug#69089: closed (Re: bug#69088: [PATCH] Eagerly indent first field in tables in lua-ts-mode)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 17 Feb 2024 08:59:02 +0000

Your bug report

#69088: [PATCH] Eagerly indent first field in tables in lua-ts-mode

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
69088: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69088
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#69088: [PATCH] Eagerly indent first field in tables in lua-ts-mode
From: Eli Zaretskii <[email-masked]>
To: john muhl <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Sat, 17 Feb 2024 10:58:12 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> Cc: [email-masked]
> Date: Mon, 12 Feb 2024 21:42:01 -0600
> From:  john muhl via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> Dmitry Gutov <[email-masked]> 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.

Thanks, installed on master, and closing the bug.

Subject: [PATCH] Eagerly indent first field in tables in lua-ts-mode
From: john muhl <[email-masked]>
To: [email-masked]
Date: Mon, 12 Feb 2024 19:23:03 -0600
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

lua-ts-mode supports aligning sibling fields to the first field
so that you can have code like:

  local t = { a = 1,
              b = 2, }

However if you prefer to put the first field on a newline like:

  local t = {
      a = 1,
      b = 2,
  }

the indentation doesn’t happen until you press RET after the
first comma. So you initially have something like (where | is
point):

  local t = {
  |
  }

This fixes that so the initial indentation is correct from the
beginning:

  local t = {
      |
  }