From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Aaron Jensen Newsgroups: gmane.emacs.bugs Subject: bug#60321: 29.0.60; ruby-mode indentation of hash or array as first arg in multiline method call Date: Sun, 1 Sep 2024 20:49:58 -0400 Message-ID: References: <60e207e0-7378-ad9f-3ef0-99df1c139939@yandex.ru> <902440c7-706a-20e1-55af-4e12e8cdda2c@yandex.ru> <1191195d-1528-dc2a-64e0-15426e4b5608@yandex.ru> <75342f40-d576-e1c6-3d63-692b80e78bfe@yandex.ru> <90f8ce9c-4a60-4af9-8ed7-eeddff557129@yandex.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000ae613b0621185220" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18326"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60321@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 02 02:52:21 2024 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 1skvIq-0004d6-V1 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 02 Sep 2024 02:52:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1skvId-0001FO-2a; Sun, 01 Sep 2024 20:52:07 -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 1skvIa-0001FE-QE for bug-gnu-emacs@gnu.org; Sun, 01 Sep 2024 20:52:05 -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 1skvIY-0008GC-UJ for bug-gnu-emacs@gnu.org; Sun, 01 Sep 2024 20:52:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=WtzGx6ycV1lzK6pNRnlOpdxsmlmpE0isdEq0JTW0mkA=; b=vDwAOEuROTR9Ku/ql2GRiphb1XOBbpLdhbLnbsMyJAHxt3j9MLQr43jBUoejxECKZctOdYCAjuGygEI0hgGfbbsqSf1YIjvVJeNVClWy8lJqd0EwWUsBnJecb7jCAgfAto0TWf1EOrcwa3bgf5+NN6TJubgnaPS4HRY5xbrEXiSeypy4fWQ0wa5L/nFxd094+LCwwybc3A3SYWGpfA054T+17SKNjmjZyHpW35f7WMD2+NEL8qVCEOUElb/2BvL8Cwj1h0y8SyIctpF+8bglgbPK0SFIAOrVoW/gRVUhRFvRZLzc3gJ5pmnZm+RUJAGSa1XIrsf1yXHm15mO4WjEVg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1skvJV-0000b4-Ka for bug-gnu-emacs@gnu.org; Sun, 01 Sep 2024 20:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Aaron Jensen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Sep 2024 00:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60321 X-GNU-PR-Package: emacs Original-Received: via spool by 60321-submit@debbugs.gnu.org id=B60321.17252383402152 (code B ref 60321); Mon, 02 Sep 2024 00:53:01 +0000 Original-Received: (at 60321) by debbugs.gnu.org; 2 Sep 2024 00:52:20 +0000 Original-Received: from localhost ([127.0.0.1]:41248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1skvIp-0000Yd-NJ for submit@debbugs.gnu.org; Sun, 01 Sep 2024 20:52:20 -0400 Original-Received: from mail-lj1-f174.google.com ([209.85.208.174]:50534) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1skvIn-0000YC-7e for 60321@debbugs.gnu.org; Sun, 01 Sep 2024 20:52:18 -0400 Original-Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2f50f1d864fso41525711fa.1 for <60321@debbugs.gnu.org>; Sun, 01 Sep 2024 17:51:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725238211; x=1725843011; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=WtzGx6ycV1lzK6pNRnlOpdxsmlmpE0isdEq0JTW0mkA=; b=MqMDQM3jKuIfeP4NtZvv+Dt8R7R8dQqXki4d9fImETo5i/gASsm3SeFURoBdTegQSw BSZZxbRQNgaim/2nWciQq+VnllI3MWJ4GsnFF/GDOGOJfeLcxOm5bfpuY32aNnAacvRz 3Clfw9n0m/7U9orLOqDP7GgByA6GlzbRsj4x/xdREk1KAcVt4eZMSieyaH3+uQ1Hfg1I IH1U4JD5WMsvphWQkml0/FWehnjRVbGo/TBHlJc3vkCbiOdTHtGfTzfZo4n2vIBL7BFY +n6ftbXB2sGgEImr7cYyA/jBBgTLv4VUw8vutHbHC8dgBzVFhRIXhzIJBVfPTZrW37ZR 2wEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725238211; x=1725843011; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WtzGx6ycV1lzK6pNRnlOpdxsmlmpE0isdEq0JTW0mkA=; b=pNOBRolaEevtK1qEzy38fQmdPpvcQC1WMakoNA/s02xf2UfCQju/J9kiIgBWNbpLjO L2REDqP8ggYbvk2JgscQ/wglutMP9zS8CDMMxMFgjqKzyRt12j+a0hWaqLHYg8Wyu7wd TxhBTZ7qcd+gce5bsFzyfLKVuI1eWGRzBvLfrux+5MsmW88dVm6yqbr9WMlhUjMe+5CM e3TFLTsX4t6OVYsUerP0LwruvnUaa5LfupgePzzgCAkh6JrafoThVmxjACa1g0xhM6nz VcbVmRpjPdfRmhtfWxe9vfQvQWDnMcHn8E6qu1qBaNiyb54gKGkssctCW4n1azaualHw zQHw== X-Gm-Message-State: AOJu0Yzr9pqcXyUvsYTrKf9Whazob9QAtO2WAh2XGUzLfaT7kv2FSHTF Z5IGSNDXa6quMx+F4GfeEkINOE7BWKtIEQDxeypfywwicHJurtaEspdDxdhcrgS8VpD/Obu/3VR BCFPD0wAbEwscE6jGJyp07wRaAAU= X-Google-Smtp-Source: AGHT+IE9Mn7dZgTokGAQNoADvO4xAlpTwn69fYjOEGfum9wwCZ6mKvcqfa2jectCjWph3mvx7zb/yl73V7DOJL2gqGE= X-Received: by 2002:a2e:611:0:b0:2f3:ed61:d168 with SMTP id 38308e7fff4ca-2f6290bc628mr29982131fa.39.1725238210346; Sun, 01 Sep 2024 17:50:10 -0700 (PDT) In-Reply-To: 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:291078 Archived-At: --000000000000ae613b0621185220 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Sep 1, 2024 at 8:19=E2=80=AFPM Dmitry Gutov wrot= e: > > On 01/09/2024 22:28, Aaron Jensen wrote: > > > Here's a corrected patch for that particular example. Thank you for > > finding that. I think I missed it because as long as you type the code > > in, it indents fine. I still have a lot to understand about SMIE, so if > > anything looks off in my patch, please let me know. > > Thanks! Just being thorough. We can add this example to the args-indent > test file, too. > > Here's a bonus example which looks off but would be more difficult to > fix (and it's not urgent, given the expression is in mixed styles): > > foo([{ > a: 2 > }, > { > b: 3 > }, > 4 > ]) Yes, that's connected to the case I mentioned... how do you think it should be indented? I wonder if it should just be 2 spaces in (rather than aligned with the opening bracket) > It would be nice to at least handle the last arg correctly - maybe we'll > just get that supported in the ts mode at some later date. > > > I didn't change the default. I wasn't sure if you wanted to change the > > defaults of all of the variables you added in the last round or just > > this one, so I'll let you handle that the way you want to. > > Sure. I think we can add this into Emacs 30 too, while the change is off > by default. Sounds good. > A few other things: > > * I think the docstring should say "Set it to nil to align to the line > with the open bracket" - it doesn't necessarily align to the beginning > of the statement (seems like a good thing). Good call. > * Let's change the first example to this, for less ambiguity? > > foo > .update({ > key =3D> value, > other_key: > }, { > key =3D> value, > other_key: > }) > Done > * Support for the new option in ruby-ts-mode (it's good to have parity). > Could you take the attached patch for a spin? Seems to work here, but > I'd like to have an extra confirmation. I don't have the treesitter stuff installed at the moment, will try this out shortly. Thanks, Aaron --000000000000ae613b0621185220 Content-Type: application/octet-stream; name="0001-Add-ruby-bracketed-argument-indentation-option.patch" Content-Disposition: attachment; filename="0001-Add-ruby-bracketed-argument-indentation-option.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_m0ka9s6n0 RnJvbSA4NzU2ZDg1NDQ4YzBhZWUzNDI3OWMxOGFlMzQzMDkwOWEzMzY0NWU0IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBBYXJvbiBKZW5zZW4gPGFhcm9uamVuc2VuQGdtYWlsLmNvbT4K RGF0ZTogU2F0LCAzMSBBdWcgMjAyNCAxOTozMToyM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lsiKQorICAgICAgICAgICAgKHNtaWUtcnVsZS1oYW5naW5nLXApKQorICAgICAg IChjb25zICdjb2x1bW4gKGN1cnJlbnQtaW5kZW50YXRpb24pKSkKICAgICAgICgoYW5kIChlcXVh bCB0b2tlbiAieyIpCiAgICAgICAgICAgICAobm90IChzbWllLXJ1bGUtcHJldi1wICIoIiAieyIg IlsiICIsIiAiPT4iICI9IiAicmV0dXJuIiAiOyIgImRvIikpCiAgICAgICAgICAgICAoc2F2ZS1l eGN1cnNpb24KZGlmZiAtLWdpdCBhL3Rlc3QvbGlzcC9wcm9nbW9kZXMvcnVieS1tb2RlLXJlc291 cmNlcy9ydWJ5LWJyYWNrZXRlZC1hcmdzLWluZGVudC5yYiBiL3Rlc3QvbGlzcC9wcm9nbW9kZXMv cnVieS1tb2RlLXJlc291cmNlcy9ydWJ5LWJyYWNrZXRlZC1hcmdzLWluZGVudC5yYgpuZXcgZmls ZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwMDAwMC4uMmQ3MmFlZDYzOTIKLS0tIC9kZXYvbnVs bAorKysgYi90ZXN0L2xpc3AvcHJvZ21vZGVzL3J1YnktbW9kZS1yZXNvdXJjZXMvcnVieS1icmFj a2V0ZWQtYXJncy1pbmRlbnQucmIKQEAgLTAsMCArMSwzMyBAQAorZm9vCisgIC51cGRhdGUoewor ICAgIGtleSA9PiB2YWx1ZSwKKyAgICBvdGhlcl9rZXk6CisgIH0sIHsKKyAgICBrZXkgPT4gdmFs dWUsCisgICAgb3RoZXJfa2V5OgorICB9KQorCit1cGRhdGUoWworICAxLAorICAyCitdLCBbCisg IDMsCisgIDQKK10pCisKK3VwZGF0ZShbeworICBrZXk6ICJ2YWx1ZSIKK30sIHsKKyAga2V5OiAi dmFsdWUiCit9XSkKKwordXBkYXRlKGFyZzEsIHsKKyAgZm9vOiAiYmFyIgorfSwgWworICAxLAor ICAyCitdLCBhcmcyKQorCisjIExvY2FsIFZhcmlhYmxlczoKKyMgcnVieS1icmFja2V0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