Yuan Fu <casouri@HIDDEN>
to control <at> debbugs.gnu.org
.
Full text available.Received: (at 70785) by debbugs.gnu.org; 9 May 2024 03:39:00 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 08 23:39:00 2024 Received: from localhost ([127.0.0.1]:52484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1s4ucW-0007I4-1Z for submit <at> debbugs.gnu.org; Wed, 08 May 2024 23:39:00 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:55509) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <casouri@HIDDEN>) id 1s4ucP-0007Hs-Uz for 70785 <at> debbugs.gnu.org; Wed, 08 May 2024 23:38:57 -0400 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-2b27c532e50so349071a91.2 for <70785 <at> debbugs.gnu.org>; Wed, 08 May 2024 20:38:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715225902; x=1715830702; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=D4ThsLjHibhUydnE125MTlMeFT++lPkCnDP5tKW6s20=; b=LFFABwxoXwJaof6SMWpsR/PmC5R86xsvAOeCNuZ9nABVr2dCt+O7NZH3KR2fEcqkGr UpRbBOiurAAr9LGsw3QQJ/cEC8/ZBOPBp5H1J+fCtckRepHhGelXCqK6STxdYQQ3IzRx bA1jPydOwYdfnRsYHuH/hqykPUjUdJGPkp+aEhjtZEFntPYMhHcwlV8Nhv2khRNZ0FJ4 Q5WHj2o6jp+GKNSsffOfBbu3jGDH3JX6t8aq8l5JKfGSVvSd+6gdiE4f27oAEbc3mhQj EKwm50H9hODhvReW7TQpea9pKqxCjnXZ4xsmWRP2+DMKzf2p9FNmGrJARNjpJLyMx5IY oylA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715225902; x=1715830702; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D4ThsLjHibhUydnE125MTlMeFT++lPkCnDP5tKW6s20=; b=t9TMVWSOGSuY7YET+1FOU4bcXRkTA4op2y14T4XvSUzOnc0YhyCo/0o1s9NWMTgUPn teLIBG5lFlqISxn9R1+IDTHsHVoilmVG7ivWzL8RK/7EFuYVqcoDhxvWVSrpJaxnhB65 Xr4p7Kv/YsIwdQAD4iFLT+gWw4XwNq8N9CivOIL9EUwDgXl+1arqGTRmI+XmZ1peg/fg K87wAoP87tYTMNnY2V9BjqNDxuljRfaDIx0A2Qrfknp2+b6aGiZzUrkmbpJXmU0J47RB qW0VnI/1DkGAhD4NYXFwRFN8/1m/+U5PkYGEcQ8L3Ew4qZnfPOIsjOMAI5n/Vxz9pAeK +ACw== X-Gm-Message-State: AOJu0YyiFscQaRem+1YGo43HK5YZRcp5/am5U1WQ7s+gHqvMQfNltmcY qPf6QWVgg4gfWiUstRb78pKHi1cdh27/WbrsWi2ZKN6+VtX9vB1hOmDA4A== X-Google-Smtp-Source: AGHT+IFRbdBmll3qSj0qqONl2IgMRqImnnl/l8JJRqNQc/yQGR7JCvDypKlkRtFD8Wu+F9jBzarXBw== X-Received: by 2002:a17:90a:bf02:b0:2b1:116c:5085 with SMTP id 98e67ed59e1d1-2b6165a66admr4638127a91.14.1715225902024; Wed, 08 May 2024 20:38:22 -0700 (PDT) Received: from smtpclient.apple ([2601:641:300:4910:38af:f15:5ce3:fab2]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2b628849ad0sm2227504a91.16.2024.05.08.20.38.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 May 2024 20:38:21 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6.1.1\)) Subject: Re: bug#70785: [PATCH] Improve indentation in 'lua-ts-mode' From: Yuan Fu <casouri@HIDDEN> In-Reply-To: <87msp4mlpo.fsf@HIDDEN> Date: Wed, 8 May 2024 20:38:10 -0700 Content-Transfer-Encoding: 7bit Message-Id: <FD16C5B3-4BE4-4CF7-A2C5-84B14FBE8129@HIDDEN> References: <87zft4mnbn.fsf@HIDDEN> <87msp4mlpo.fsf@HIDDEN> To: john muhl <jm@HIDDEN> X-Mailer: Apple Mail (2.3731.700.6.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70785 Cc: 70785 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) > On May 5, 2024, at 6:26 AM, john muhl <jm@HIDDEN> wrote: > > <0001-Improve-indentation-in-lua-ts-mode-bug-70785.patch> Merged. Thank you! Yuan
bug-gnu-emacs@HIDDEN
:bug#70785
; Package emacs
.
Full text available.Received: (at 70785) by debbugs.gnu.org; 5 May 2024 13:29:26 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 05 09:29:26 2024 Received: from localhost ([127.0.0.1]:59752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1s3bvh-0005FK-3J for submit <at> debbugs.gnu.org; Sun, 05 May 2024 09:29:26 -0400 Received: from flow6-smtp.messagingengine.com ([103.168.172.141]:56817) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <jm@HIDDEN>) id 1s3bve-0005FC-5n for 70785 <at> debbugs.gnu.org; Sun, 05 May 2024 09:29:23 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailflow.nyi.internal (Postfix) with ESMTP id 290D22003E3 for <70785 <at> debbugs.gnu.org>; Sun, 5 May 2024 09:28:53 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 05 May 2024 09:28:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pub.pink; h=cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1714915733; x=1714922933; bh=OaI03ZJMoO 3sEPUxk21NwqSgfO2tIee73on871MPYfY=; b=eXCgIak/sV9WTWM8qdsH+39ckX hxeH/wZHDYJkTlZy8nW5Mqf5WI7S6VfsIsPF7UIcElqjYpAe59lOZ2DUo87x8Zvr fdbQOcjKb/ea5kIXMeLJYQZXZdzzfNLfiWO0CZpG1RxYfMmY6ADgvKlgX4lqrHjY mhisDYOV/UlATbF3zrW2seXj6DjcWcyRQBuxMl2/NT7DX8zYokQC0OJ9nJOEMKAl mWNYGSh8TBqpaL3SyKyas7IrQtdYZfOsuARs9+BBYMhD2dsmnyjjHGzHLwdUSwjB 7+z385NopyK448MC3IKP4B+yfsy9gzbnehQFYTuiNT3WNlTdt+QnkoPQIYYg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1714915733; x=1714922933; bh=OaI03ZJMoO3sEPUxk21NwqSgfO2t Iee73on871MPYfY=; b=ked0Hv3FkkKeTgwoCWgos/7JkWTcEVX+3sGcIVyrtAq0 uMjV2v8fAX0beg2+Td5VFejF6XgTywjU935v+DVx92yuAiVn+iAWzRz9VrQ2ingN vRmPxilQSlf+OooF6qnAe3k76Yu5r31TkyDNSs8BzRmzDhZdPYQ7snWzl+Wsq+4W WmXXiXG71QGRBtDmL5zvC7suhkoOeUxQUIj3GFVQtKl3BsMBWtyiWGf20h+2zvp6 bGRKrfYE38VjD8tLyEDfpQdJstM83Ei8dsZvbafEtYPzgwUmGBD5VbPd+7igSlv2 //3vLg/tssvA/xm8iKl19i0EsIHPmk0nSQLLS/RZNw== X-ME-Sender: <xms:lIk3ZlO7aKYdgijJYXP2Ys2HFhYt1QJW9TS8l_vpBzUjhk2aNhaSfA> <xme:lIk3Zn9wXuWIb4s4qOYGNxrM68xxF4aUetVkS2Dkx8q7tYS9O9aZfOWTItkMVJg85 4t7JEWqIr1jQV88Qv0> X-ME-Received: <xmr:lIk3ZkRYvFD7t_FKTa5yZq9lMGGiZfRwzzW2GxmNWiJ6vm9NKVXkv_EBroULezhzaoBKofwDLf5yB9e6qCk95PdtboKwtM8> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddvgedgieejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgovehorghsthgrlhdqffegtdefqddtheculdeftd dtmdenucfjughrpehffgfhvffuffgjkfggtgguseertdertddtredtnecuhfhrohhmpehj ohhhnhcumhhuhhhluceojhhmsehpuhgsrdhpihhnkheqnecuggftrfgrthhtvghrnhepge ehiedvgeekhedugedtveefffeihedtgeehfeetieejvdeffefgffehffehheejnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhmsehpuhgsrd hpihhnkh X-ME-Proxy: <xmx:lIk3ZhsZEjOfuf6_6osr58pr6qGuDT_Le9Zf3C6Fc2AFGjXoF2H4rg> <xmx:lIk3Zte2aszYVU5Mh2CIaMKPsLdwcDBAORriF55FY-pbzBLbkKxGOg> <xmx:lIk3Zt2fz2oMAgJbVN7XsRxtkV7QxOp11f6KuA4Sn_Fz5ynN_nJdRQ> <xmx:lIk3Zp8wYXxUtuX2ZFWyrdYES_Fpvz2ek8IobvYnVwi8eNPwSk4kMA> <xmx:lYk3ZnodKKw-cEt5irlzMJPAIqh2Cb4ahMNtYPONFhCK_3_LPNgIxSIT> Feedback-ID: i74194916:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for <70785 <at> debbugs.gnu.org>; Sun, 5 May 2024 09:28:52 -0400 (EDT) References: <87zft4mnbn.fsf@HIDDEN> User-agent: mu4e 1.10.8; emacs 30.0.50 From: john muhl <jm@HIDDEN> To: 70785 <at> debbugs.gnu.org Subject: Re: bug#70785: [PATCH] Improve indentation in 'lua-ts-mode' Date: Sun, 05 May 2024 08:26:44 -0500 In-reply-to: <87zft4mnbn.fsf@HIDDEN> Message-ID: <87msp4mlpo.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Improve-indentation-in-lua-ts-mode-bug-70785.patch X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 70785 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) From 4d3408607fbf560f5427fbe6193307b16a82ceff Mon Sep 17 00:00:00 2001 From: john muhl <jm@HIDDEN> Date: Fri, 3 May 2024 15:51:01 -0500 Subject: [PATCH] Improve indentation in 'lua-ts-mode' (bug#70785) * lisp/progmodes/lua-ts-mode.el (lua-ts--simple-indent-rules): - Ignore comments when aligning arguments, parameters and fields. - Apply simpler rules to simpler usage of anonymous functions. - Better handling of table as a function argument. (lua-ts--comment-first-sibling-matcher): (lua-ts--first-real-sibling-anchor): (lua-ts--last-arg-function-call-matcher): (lua-ts--top-level-function-call-matcher): New function. (lua-ts--g-parent): (lua-ts--g-g-parent): New function. (lua-ts--g-g-g-parent): Use it. * test/lisp/progmodes/lua-ts-mode-resources/indent.erts: Add tests. --- lisp/progmodes/lua-ts-mode.el | 63 +++++++++++++++++-- .../lua-ts-mode-resources/indent.erts | 40 ++++++++++++ 2 files changed, 97 insertions(+), 6 deletions(-) diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el index 6b55fefbf84..57aa3db1c85 100644 --- a/lisp/progmodes/lua-ts-mode.el +++ b/lisp/progmodes/lua-ts-mode.el @@ -291,6 +291,14 @@ lua-ts--simple-indent-rules (parent-is "string_content") (node-is "]]")) no-indent 0) + ((and (n-p-gp "field" "table_constructor" "arguments") + lua-ts--multi-arg-function-call-matcher + lua-ts--last-arg-function-call-matcher) + standalone-parent lua-ts-indent-offset) + ((and (n-p-gp "}" "table_constructor" "arguments") + lua-ts--multi-arg-function-call-matcher + lua-ts--last-arg-function-call-matcher) + standalone-parent 0) ((and (n-p-gp "field" "table_constructor" "arguments") lua-ts--multi-arg-function-call-matcher) parent lua-ts-indent-offset) @@ -311,10 +319,15 @@ lua-ts--simple-indent-rules (and (parent-is "parameters") lua-ts--first-child-matcher) (and (parent-is "table_constructor") lua-ts--first-child-matcher)) standalone-parent lua-ts-indent-offset) + ((and (not lua-ts--comment-first-sibling-matcher) + (or (parent-is "arguments") + (parent-is "parameters") + (parent-is "table_constructor"))) + lua-ts--first-real-sibling-anchor 0) ((or (parent-is "arguments") (parent-is "parameters") (parent-is "table_constructor")) - (nth-sibling 1) 0) + standalone-parent lua-ts-indent-offset) ((and (n-p-gp "block" "function_definition" "parenthesized_expression") lua-ts--nested-function-block-matcher lua-ts--nested-function-block-include-matcher) @@ -337,6 +350,9 @@ lua-ts--simple-indent-rules lua-ts--nested-function-end-matcher lua-ts--nested-function-last-function-matcher) parent 0) + ((and (n-p-gp "end" "function_definition" "arguments") + lua-ts--top-level-function-call-matcher) + standalone-parent 0) ((n-p-gp "end" "function_definition" "arguments") parent 0) ((or (match "end" "function_definition") (node-is "end")) @@ -385,24 +401,39 @@ lua-ts--function-definition-p "Return t if NODE is a function_definition." (equal "function_definition" (treesit-node-type node))) +(defun lua-ts--g-parent (node) + "Return the grand-parent of NODE." + (let ((parent (treesit-node-parent node))) + (treesit-node-parent parent))) + +(defun lua-ts--g-g-parent (node) + "Return the great-grand-parent of NODE." + (treesit-node-parent (lua-ts--g-parent node))) + (defun lua-ts--g-g-g-parent (node) "Return the great-great-grand-parent of NODE." - (let* ((parent (treesit-node-parent node)) - (g-parent (treesit-node-parent parent)) - (g-g-parent (treesit-node-parent g-parent))) - (treesit-node-parent g-g-parent))) + (treesit-node-parent (lua-ts--g-g-parent node))) (defun lua-ts--multi-arg-function-call-matcher (_n parent &rest _) "Matches if PARENT has multiple arguments." (> (treesit-node-child-count (treesit-node-parent parent)) 3)) +(defun lua-ts--last-arg-function-call-matcher (node parent &rest _) + "Matches if NODE's PARENT is the last argument in a function call." + (let* ((g-parent (lua-ts--g-parent node)) + (last (1- (treesit-node-child-count g-parent t)))) + (treesit-node-eq parent (seq-elt (treesit-node-children g-parent t) last)))) + (defun lua-ts--nested-function-argument-matcher (node &rest _) "Matches if NODE is in a nested function argument." (save-excursion (goto-char (treesit-node-start node)) (treesit-beginning-of-defun) (backward-char 2) - (not (looking-at ")(")))) + (and (not (looking-at ")(")) + (not (equal "chunk" + (treesit-node-type + (lua-ts--g-parent (treesit-node-at (point))))))))) (defun lua-ts--nested-function-block-matcher (node &rest _) "Matches if NODE is in a nested function block." @@ -438,6 +469,26 @@ lua-ts--nested-function-last-function-matcher (treesit-induce-sparse-tree parent #'lua-ts--function-definition-p))) (= 1 (length (cadr sparse-tree))))) +(defun lua-ts--comment-first-sibling-matcher (node &rest _) + "Matches if NODE if it's previous sibling is a comment." + (let ((sibling (treesit-node-prev-sibling node))) + (equal "comment" (treesit-node-type sibling)))) + +(defun lua-ts--top-level-function-call-matcher (node &rest _) + "Matches if NODE is within a top-level function call." + (let* ((g-g-p (lua-ts--g-g-parent node)) + (g-g-g-p (lua-ts--g-g-g-parent node))) + (and (equal "function_call" (treesit-node-type g-g-p)) + (equal "chunk" (treesit-node-type g-g-g-p))))) + +(defun lua-ts--first-real-sibling-anchor (_n parent _) + "Return the start position of the first non-comment child of PARENT." + (treesit-node-start + (seq-first + (seq-filter + (lambda (n) (not (equal "comment" (treesit-node-type n)))) + (treesit-node-children parent t))))) + (defun lua-ts--variable-declaration-continuation (node &rest _) "Matches if NODE is part of a multi-line variable declaration." (treesit-parent-until node diff --git a/test/lisp/progmodes/lua-ts-mode-resources/indent.erts b/test/lisp/progmodes/lua-ts-mode-resources/indent.erts index 48184160b4d..ba7bad1b452 100644 --- a/test/lisp/progmodes/lua-ts-mode-resources/indent.erts +++ b/test/lisp/progmodes/lua-ts-mode-resources/indent.erts @@ -66,6 +66,10 @@ end return f end +f6(function() +print'ok' +end) + ;(function () return true end)() @@ -118,6 +122,10 @@ function f6(...) return f end +f6(function() + print'ok' +end) + ;(function () return true end)() @@ -406,6 +414,15 @@ a = 1, b = 2, }, nil) + +Test(nil, { + a = 1, + b = 2, + }) + +fn( -- comment + 1, + 2) =-= h( "string", @@ -443,6 +460,15 @@ Test({ b = 2, }, nil) + +Test(nil, { + a = 1, + b = 2, +}) + +fn( -- comment + 1, + 2) =-=-= Name: Parameter Indent @@ -464,6 +490,9 @@ local f3 = function( a, b, c, d ) print(a,b,c,d) end + +local f4 = function(-- comment +a, b, c) =-= function f1( a, @@ -481,6 +510,9 @@ local f3 = function( a, b, c, d ) print(a,b,c,d) end + +local f4 = function(-- comment + a, b, c) =-=-= Name: Table Indent @@ -506,6 +538,10 @@ a = 1, b = 2, c = 3, } + +local a = { -- hello world! + b = 10 +} =-= local Other = { First={up={Step=true,Jump=true}, @@ -527,6 +563,10 @@ local Other = { b = 2, c = 3, } + +local a = { -- hello world! + b = 10 +} =-=-= Name: Continuation Indent -- 2.41.0
bug-gnu-emacs@HIDDEN
:bug#70785
; Package emacs
.
Full text available.Received: (at submit) by debbugs.gnu.org; 5 May 2024 12:54:45 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 05 08:54:45 2024 Received: from localhost ([127.0.0.1]:59584 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1s3bO9-0004mx-6L for submit <at> debbugs.gnu.org; Sun, 05 May 2024 08:54:45 -0400 Received: from lists.gnu.org ([2001:470:142::17]:35856) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <jm@HIDDEN>) id 1s3bO6-0004mr-Uh for submit <at> debbugs.gnu.org; Sun, 05 May 2024 08:54:43 -0400 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 <jm@HIDDEN>) id 1s3bNb-0003tA-Ca for bug-gnu-emacs@HIDDEN; Sun, 05 May 2024 08:54:11 -0400 Received: from fhigh1-smtp.messagingengine.com ([103.168.172.152]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <jm@HIDDEN>) id 1s3bNY-0002XH-He for bug-gnu-emacs@HIDDEN; Sun, 05 May 2024 08:54:10 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 1506511400E0 for <bug-gnu-emacs@HIDDEN>; Sun, 5 May 2024 08:54:06 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sun, 05 May 2024 08:54:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pub.pink; h=cc :content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:subject:subject:to:to; s=fm3; t=1714913646; x=1715000046; bh=VEm8VP8+bbYqdvIKnDaU2aaYlEl+3Ht+ bWTe9okLp0M=; b=TBUAVMoEKeOWcT/s5lrQEdqxQ+KE4pWTHjuWbsSm+bEmd/SH /bVTknUDK5ZIEzm5DcboOLOHlprQX7vCAKi3VsvltmYiyCokPi4A6+aM0vUnmfeK Z2Nav6k+vGRXqKZ8hi0S3k5DywjyNOUgmUDlz7zPdO07vtfX2Y6VIK2vd5dnDp2A 77+kFQ73F04wMPgL5EN8GoNKq3ZmYruSCcUjUDD3BGTzWtxQy4addEmHm+VaGQHv hb2owvI411kqXo36Mg1C3BI4TyhzXyiwb77lBZsEfN8soo6JC9j34Cg6qMysAmE1 4N9fX+rTq+RVqFQSm9LkRaOHlnZuXzF3VnA2dQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1714913646; x=1715000046; bh=VEm8VP8+bbYqdvIKnDaU2aaYlEl+3Ht+bWT e9okLp0M=; b=YA3hA0Lf8OpUZDLNzL7CnTiBAMxHbcZuGvYeI94NtxyTkToxnrJ 53lQXI+wlyqBiXMczkk90cJZPJkt8V6hYM6czBnggsi3TxY2xwBpNW5ndXIIVYOl h9ju17YVfTDbpqMStBxPEt3xuZ7CwnLVJKvTjjV1Hz3tOUNVo+wrxIhOc3Vndkb3 tFQ11mHLru1CEyFXMTiT3ekgUzoByUuFR2L0/nuL7mtBHRsiSz9t8u2dH/M+8SLH Ctexdfn8uZUJ5bGWt1T6/WD6lncxKDlLBOUor/HHJUh4wQUS0ABzvD3FAtYVLFVE UrBq31JPMwbBxFZL4M/EAZ0nMv5Zg2UKFEA== X-ME-Sender: <xms:bYE3ZtZ5ilOnef7UrStPs7n8UWFKe9NcMrzaJwFesVLomj1wPYpjIA> <xme:bYE3ZkZAqij8nMGWuzKfHU1fT7msqC3JgM-98EUqRCY_wrSh0FHmXg89hnbewVxL6 nFUT1po3pmXTz2s4P8> X-ME-Received: <xmr:bYE3Zv-ZJDK5nwKM5CMDxDTM3EWlDQMQTQqSmWQ5rN8RTqmpvjfcksvgQnr51QfX0FPwPtrccm6Dd7FamMLp-b_kqg5lY8E> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddvgedgheelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkgggtsehttdertddttd dtnecuhfhrohhmpehjohhhnhcumhhuhhhluceojhhmsehpuhgsrdhpihhnkheqnecuggft rfgrthhtvghrnhepgefhudekueehudeugffhgfegfeevhfetjeehhfeuleffgfeguedtff dvteeutedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mhepjhhmsehpuhgsrdhpihhnkh X-ME-Proxy: <xmx:bYE3ZroX6Jl8Z9eXpWKIuWJ9siFEYAmhm94_GCl5t4k5UAXlcCJMNQ> <xmx:bYE3Zor63nQIdya4pBAHLNiUmYN7jHpmNdA0fWixmzMNN9tv9woGxw> <xmx:bYE3ZhRFJzyqdx6K5xyYA8yVs5cOqOUKfiWLcsO0E3ZCheED--dVAg> <xmx:bYE3Zgrz1V1YT3gJBusAez-0WxYYK09NVZDk1Llb6JQE806DR731yA> <xmx:boE3ZlCg4AwGlXlpI4BamyhmbO0341oIGkauTSCDsoobILIJBA2NbZMb> Feedback-ID: i74194916:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for <bug-gnu-emacs@HIDDEN>; Sun, 5 May 2024 08:54:05 -0400 (EDT) From: john muhl <jm@HIDDEN> To: bug-gnu-emacs@HIDDEN Subject: [PATCH] Improve indentation in 'lua-ts-mode' Date: Sun, 05 May 2024 07:54:04 -0500 Message-ID: <87zft4mnbn.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=103.168.172.152; envelope-from=jm@HIDDEN; helo=fhigh1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.3 (/) Tags: patch I was contacted off-list about a few tweaks to the indentation. They seemed fine so here they are. 1. Change it so that comments are ignored when indenting table fields and function arguments/parameters: -- before local mt = { -- the comment first = 1, second = 2, } -- after local mt = { -- the comment first = 1, second = 2, } 2. It also changes how tables are handled in function arguments: -- before fn(true, { x = 1, y = 0, }) -- after fn(true, { x = 1, y = 0, }) 3. And it changes how simple use of an anonymous function is indented: -- before fn(function() print'ok' end) -- after fn(function() print'ok' end) In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.0) of 2024-05-02 built on localhost Repository revision: 962bb71b4a813eb9c3832494746695d32d6f9109 Repository branch: master System Description: Fedora Linux 39 (Thirty Nine) Configured using: 'configure --with-pgtk --prefix=/home/jm/.local'
john muhl <jm@HIDDEN>
:bug-gnu-emacs@HIDDEN
.
Full text available.bug-gnu-emacs@HIDDEN
:bug#70785
; Package emacs
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.