From unknown Mon Aug 18 14:23:43 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#60321 <60321@debbugs.gnu.org> To: bug#60321 <60321@debbugs.gnu.org> Subject: Status: 29.0.60; ruby-mode indentation of hash or array as first arg in multiline method call Reply-To: bug#60321 <60321@debbugs.gnu.org> Date: Mon, 18 Aug 2025 21:23:43 +0000 retitle 60321 29.0.60; ruby-mode indentation of hash or array as first arg = in multiline method call reassign 60321 emacs submitter 60321 Dmitry Gutov severity 60321 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 25 16:29:29 2022 Received: (at submit) by debbugs.gnu.org; 25 Dec 2022 21:29:29 +0000 Received: from localhost ([127.0.0.1]:50199 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9YYj-0002cP-7B for submit@debbugs.gnu.org; Sun, 25 Dec 2022 16:29:29 -0500 Received: from lists.gnu.org ([209.51.188.17]:45608) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9YYh-0002cF-Ql for submit@debbugs.gnu.org; Sun, 25 Dec 2022 16:29:28 -0500 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 1p9YYh-0005fS-Le for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 16:29:27 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p9YYf-0006oM-QV for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 16:29:27 -0500 Received: by mail-wm1-x32a.google.com with SMTP id fm16-20020a05600c0c1000b003d96fb976efso4267156wmb.3 for ; Sun, 25 Dec 2022 13:29:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:content-language:references :to:subject:from:user-agent:mime-version:date:message-id:sender:from :to:cc:subject:date:message-id:reply-to; bh=FaKgCphL0BiOAeir2i+HxIhDZi6RNovCtJwBDIlsq54=; b=GTxjojhXDlfoTvh9CA+uP4M20fDOiiVN+1CUCcVb5ZT7Q/HCNJcrwT7wr5bfN6OQoq B/126N+qpZ2aOWxytKbzy8DUlQXOnve6jC7weSp3pjktFMspC3jJo7qlc0/GbwondNtJ 3Pog3pygDobUcyzZyP1huthDg83WFkHG/+5n2onkcEXXX+bfcsCSoi2uogsS94WDnqeM ovTjw09zPy80dx0xa/IezaFiNt8TrW9LpSjgHZA8/n7uICZonvHgre3YxZx4Qs1QvVxH 812mr9jDGUNkhiwCxgtr4aknCfzxiavtgn34j2+Kx8DkCrxzRS6qlBzJcCM5h4ronKXF o95A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:content-language:references :to:subject:from:user-agent:mime-version:date:message-id:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FaKgCphL0BiOAeir2i+HxIhDZi6RNovCtJwBDIlsq54=; b=SL6b9q+/L0Ui+j+PshfpLWWSLgQizIKc26ENF5j+UyxSuPKBsNGW7UM60LJdeh5l3E AfDDMb5rA5gc7lvQb/eSA1ioWWuloA/eOOi5E7Cg+OW5WcK9SXs9HS1oBiMSsezFEjkv 9T9tIbQY23WwCS0Cg8pT+geC/rn7nhaltM4pjfJGMUWOSCchSqP8J6Egegr/M1W/33xL 4Iev8qlke146RaCepc98428BsjdLBqQYYjtSlQpzI2h+Ti5ejjY0QtUDiRaiwwMJqeHu UTuuVWCcxck7cn4TjdftdRKrKWSHPGtC6p46iPykJtqZphyyiKd9Tct/hgYVBe8wJliU 2I8Q== X-Gm-Message-State: AFqh2krHX7gTKIgg8QCkxopuvoXRpZExoQJqyC0cU40IkoV1q99F5gxg dwOVPo4SyqIwMBGqzeP56PgdqROyuAg= X-Google-Smtp-Source: AMrXdXtnsZx4pCtANiI6O6dRZaTbKsMgWEZhWmnkOdxLJbS6iSlV2xJQ3mLAu7jJJ1KlZ8g2kwpBWw== X-Received: by 2002:a05:600c:4255:b0:3d3:3d34:5d63 with SMTP id r21-20020a05600c425500b003d33d345d63mr12225413wmm.8.1672003763127; Sun, 25 Dec 2022 13:29:23 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id v26-20020a7bcb5a000000b003cf4eac8e80sm13697165wmj.23.2022.12.25.13.29.22 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 25 Dec 2022 13:29:22 -0800 (PST) Message-ID: <1191195d-1528-dc2a-64e0-15426e4b5608@yandex.ru> Date: Sun, 25 Dec 2022 23:29:21 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 From: Dmitry Gutov Subject: 29.0.60; ruby-mode indentation of hash or array as first arg in multiline method call To: bug-gnu-emacs@gnu.org References: <4e44df18-207c-c7ca-0588-7285f3008dfb@yandex.ru> <358bbd65-9375-04c8-f0a2-24a4383f142e@yandex.ru> <2b4a91e1-bad1-382f-dd64-abf171efb404@yandex.ru> <60e207e0-7378-ad9f-3ef0-99df1c139939@yandex.ru> <902440c7-706a-20e1-55af-4e12e8cdda2c@yandex.ru> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=raaahh@gmail.com; helo=mail-wm1-x32a.google.com X-Spam_score_int: -7 X-Spam_score: -0.8 X-Spam_bar: / X-Spam_report: (-0.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) X-Debbugs-CC: aaronjensen@gmail.com Splitting off from debbugs#60186, second try. Since this setting also seems orthogonal to the "simplified" preference, and it'll require some more work. For future reference, here are the relevant Rubocop settings: https://docs.rubocop.org/rubocop/cops_layout.html#layoutfirsthashelementindentation https://docs.rubocop.org/rubocop/cops_layout.html#layoutfirstarrayelementindentation On 25/12/2022 02:12, Aaron Jensen wrote: >> We could also discuss cases like >> >> foo = bar({ >> tee: 1, >> qux: 2 >> }) >> >> baz([ >> 1, >> 2, >> 3 >> ]) >> >> but those would be an orthogonal feature. And I don't see them much in >> the wild, for some reason. > The same logic would apply. It doesn't matter how many indent starters > there are in a line, the indentation should only increase by one: > > > foo = bar({ > tee: 1, > qux: 2 > }) > > baz([ > 1, > 2, > 3 > ]) > > Of course, that begs the question what happens if you do this: > > baz([ > 1, > 2, > 3 > ] > ) Here are a couple trickier examples: takes_multi_pairs_hash(x: { a: 1, b: 2 }) and_in_a_method_call({ no: :difference }, foo, bar) AFAICT even Rubocop doesn't have a setting which would indent the second one somewhat reasonably, while keeping two-space indent before "no". > And, I think again, the answer is a social one, rather than a technical one. > > enh-ruby-mode and vim both do this this: > > baz([ > 1, > 2, > 3 > ] > ) Yup, that looks pretty bizarre. OTOH, I don't see why a developer would put a newline between "]" and ")" in this case. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 25 18:46:26 2022 Received: (at 60321) by debbugs.gnu.org; 25 Dec 2022 23:46:26 +0000 Received: from localhost ([127.0.0.1]:50358 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9ahG-0000x5-1c for submit@debbugs.gnu.org; Sun, 25 Dec 2022 18:46:26 -0500 Received: from mail-pl1-f171.google.com ([209.85.214.171]:41716) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9ahE-0000wr-On for 60321@debbugs.gnu.org; Sun, 25 Dec 2022 18:46:25 -0500 Received: by mail-pl1-f171.google.com with SMTP id jl4so3250198plb.8 for <60321@debbugs.gnu.org>; Sun, 25 Dec 2022 15:46:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=smI/z2zLCYnUj31j5QxB0AfnM3u0kc3TmMdJlt2tX1g=; b=Wubt8IYYYN5HWSXj90/jdm2eEtLjlnDfFSdqO+TLIf73xZIkKwJN+ZZfjC1DUUJCYa 2MftOAPywFggs9UwiYcBzbbkAg3Vnlb47fMbzlLZvRyiUjgtvqlQCq24/NCc/ZkmJDud NOKbhAsUPP+trT6ULD2Pfe7ozUPN6Vf/LtL7g0qCoLqr1M7p5gccSYxmOmFa6V21ILbD 5Ff6ReG+zByP33V5RP6n59PjMOcqZjusJgGKk+KCGv5AJHMmrYyAgmKQ7+FTE00vO1zL yW2FJKpP8jZi/a9LWOaCr8Bmx+NVykmLqDRE/cZQZwtbrAOcK0FWcJ3StuOmTCixBWDr Z0rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=smI/z2zLCYnUj31j5QxB0AfnM3u0kc3TmMdJlt2tX1g=; b=UF6vBOz6WDfiewHojnxhncJ4iwayyDwwCvsbGq7ngFQE0Wf1q6EQDPM7H1viYrmmxO atJtyLhWlNf8mjTm11hu+xe0hR1gjQ5Sb/OUvTGLhgJ9lxhDJuqkKL7HzH74Ujm2HFsK G0dR/muCeB9XizelDQJE7ZK1osp3rfXay7dYzMq00co9S2W9Yo/VKAVHMvythfpljxHC wUEEN+S5yqvqGwf8kKaoWWJOXKjySlqY1gs7GezeG5YvIjLOiwsGPF5tCzZgEegi6gdg E4c7lSw1dAwtlb4mCf+8ZDJor9ajRNnAlJOfIBjqCx4pJ5c6fnbq2Qm1fdvYDb/IhCnc 380A== X-Gm-Message-State: AFqh2koE33lzknUi7ZT2U/l0EUlIfTlgKwqfLqg3H88BbferzSMLSGgt g2ioSRiOkgyViWk2voUcFwiVQU93DHSL6KIx048= X-Google-Smtp-Source: AMrXdXtT118kMALEMT5qyAmI0IvVUUlmOfHVOCh30aysOYzF/Mcu/M9HDZXPVvs9ZpjJY3nROgZcSaoNURdRG9R1Bcw= X-Received: by 2002:a17:90b:d8a:b0:223:f336:1519 with SMTP id bg10-20020a17090b0d8a00b00223f3361519mr1288524pjb.198.1672011978822; Sun, 25 Dec 2022 15:46:18 -0800 (PST) MIME-Version: 1.0 References: <4e44df18-207c-c7ca-0588-7285f3008dfb@yandex.ru> <358bbd65-9375-04c8-f0a2-24a4383f142e@yandex.ru> <2b4a91e1-bad1-382f-dd64-abf171efb404@yandex.ru> <60e207e0-7378-ad9f-3ef0-99df1c139939@yandex.ru> <902440c7-706a-20e1-55af-4e12e8cdda2c@yandex.ru> <1191195d-1528-dc2a-64e0-15426e4b5608@yandex.ru> In-Reply-To: <1191195d-1528-dc2a-64e0-15426e4b5608@yandex.ru> From: Aaron Jensen Date: Sun, 25 Dec 2022 18:46:07 -0500 Message-ID: Subject: Re: bug#60321: 29.0.60; ruby-mode indentation of hash or array as first arg in multiline method call To: Dmitry Gutov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60321 Cc: 60321@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sun, Dec 25, 2022 at 4:30 PM Dmitry Gutov wrote: > > X-Debbugs-CC: aaronjensen@gmail.com > > Splitting off from debbugs#60186, second try. > > Since this setting also seems orthogonal to the "simplified" preference, > and it'll require some more work. > > For future reference, here are the relevant Rubocop settings: > > https://docs.rubocop.org/rubocop/cops_layout.html#layoutfirsthashelementindentation > https://docs.rubocop.org/rubocop/cops_layout.html#layoutfirstarrayelementindentation > > On 25/12/2022 02:12, Aaron Jensen wrote: > >> We could also discuss cases like > >> > >> foo = bar({ > >> tee: 1, > >> qux: 2 > >> }) > >> > >> baz([ > >> 1, > >> 2, > >> 3 > >> ]) > >> > >> but those would be an orthogonal feature. And I don't see them much in > >> the wild, for some reason. > > The same logic would apply. It doesn't matter how many indent starters > > there are in a line, the indentation should only increase by one: > > > > > > foo = bar({ > > tee: 1, > > qux: 2 > > }) > > > > baz([ > > 1, > > 2, > > 3 > > ]) > > > > Of course, that begs the question what happens if you do this: > > > > baz([ > > 1, > > 2, > > 3 > > ] > > ) > > Here are a couple trickier examples: > > takes_multi_pairs_hash(x: { > a: 1, > b: 2 > }) enh-ruby-mode and vim do the same thing, which I think is fine: takes_multi_pairs_hash(x: { a: 1, b: 2 }) Though again, the best answer imo is "don't do this". > > and_in_a_method_call({ > no: :difference > }, > foo, > bar) enh-ruby-mode: and_in_a_method_call({ no: :difference }, foo, bar) Vim: and_in_a_method_call({ no: :difference }, foo, bar) I think this falls under something I wouldn't put too much effort into fixing. I would write it like this: and_in_a_method_call( { no: :difference }, foo, bar ) Which indents in a straightforward manner. If I had to type it as above, I would probably indent it like this: and_in_a_method_call({ no: :difference }, foo, bar) But I can't imagine that would be easy to implement at all, so I wouldn't bother. > AFAICT even Rubocop doesn't have a setting which would indent the second > one somewhat reasonably, while keeping two-space indent before "no". > > > And, I think again, the answer is a social one, rather than a technical one. > > > > enh-ruby-mode and vim both do this this: > > > > baz([ > > 1, > > 2, > > 3 > > ] > > ) > > Yup, that looks pretty bizarre. OTOH, I don't see why a developer would > put a newline between "]" and ")" in this case. Exactly, that's what I meant by a social problem. We have a (somewhat harsh) saying for stuff like this: you get what you deserve. That's actually why I don't mind enh-ruby-mode's behavior here. It's clearly undefined/out of bounds, so that tells a person they are currently out of bounds and they should get back in bounds. Aaron From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 26 20:16:40 2022 Received: (at 60321) by debbugs.gnu.org; 27 Dec 2022 01:16:40 +0000 Received: from localhost ([127.0.0.1]:54382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9ya7-00006r-OD for submit@debbugs.gnu.org; Mon, 26 Dec 2022 20:16:39 -0500 Received: from mail-wr1-f46.google.com ([209.85.221.46]:38431) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9ya3-00006W-RZ for 60321@debbugs.gnu.org; Mon, 26 Dec 2022 20:16:37 -0500 Received: by mail-wr1-f46.google.com with SMTP id n3so10473054wrc.5 for <60321@debbugs.gnu.org>; Mon, 26 Dec 2022 17:16:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=15algWF4IAmoDoWU6/OlRTFdBhoTGIUmXL1M+IeAZZI=; b=lAVxa51H4L7dq38zW9KS0dtPSw1yNfnZsVhjo5HcEjL1pSG0sqxoXCqipTd78Jn/tc 1+GH9bYhSkQejwF6EOxJaESDkD71uS435giI+ScCwRofpktw7tCcXicSBuZ/sTX0OGOE NQqNhM3zX2MeyNXPkAe6ZbKQv73WDlXZAhSOgtakIT3lSqejbpKrsCrDOJZAZEdhfAZz hFPbTbomyRHM/o5otpAKNIYuMNILyK3zuSeJfMcNNqGIqnP5La/ywALCvyGL6/59pFSW sYR3PitvHFpJiP1L9gyFJ8SRzpY3sGoKv2zsDctapcUd02FSXb2SOum4zhlw5PiPNFu+ AiQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=15algWF4IAmoDoWU6/OlRTFdBhoTGIUmXL1M+IeAZZI=; b=qpz90+uIU61wELMs+RnDA4GxdQHbapxDCnpgS6QVliF93oqBir1j/F6aLxM1dmuOGR miGouWfL8ZhWjXSgruLyUjxlmjMGRvbztxVbKTt3KN5ZeRmT+KeoSTDYhZebTR+qQ7dn 34TtheJL271Q50BUQDhvpLWra0cV9Ke+iTUuq6AATWnH3SMr+sn+oI6NCoZ47Q+jrTwt ApaaVWKGbp21QpIeWvWrjlCINZlv6ilDeBKkZo5Z8zeZrIv0Wn4nyE8ZnkZIoEKxOh0y 4sM4sLYvpxHZ41gvrXmk89XEzYArmcaD9XWmsWzErGmZv+E/r7CtWBY4VvUwoJDfzmHs OhgA== X-Gm-Message-State: AFqh2koQP0nstC+oh2mb7/dyvXavdEnhxjQXiZ2BPm2RrJ+g8xB/5t4i JqzMxi4tAbONxlcSSyoXbvM= X-Google-Smtp-Source: AMrXdXvBE8k75tylI3tBP/ytmvr1O8opPZ8z/kR/imlim/VE/q9eDV9jz8d9TIMtdbfFndJ1bS+cRQ== X-Received: by 2002:a5d:5544:0:b0:26d:2af7:420 with SMTP id g4-20020a5d5544000000b0026d2af70420mr12004831wrw.33.1672103789949; Mon, 26 Dec 2022 17:16:29 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id f13-20020a5d4dcd000000b0023659925b2asm11323815wru.51.2022.12.26.17.16.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Dec 2022 17:16:29 -0800 (PST) Message-ID: <75342f40-d576-e1c6-3d63-692b80e78bfe@yandex.ru> Date: Tue, 27 Dec 2022 03:16:27 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: bug#60321: 29.0.60; ruby-mode indentation of hash or array as first arg in multiline method call Content-Language: en-US To: Aaron Jensen References: <4e44df18-207c-c7ca-0588-7285f3008dfb@yandex.ru> <358bbd65-9375-04c8-f0a2-24a4383f142e@yandex.ru> <2b4a91e1-bad1-382f-dd64-abf171efb404@yandex.ru> <60e207e0-7378-ad9f-3ef0-99df1c139939@yandex.ru> <902440c7-706a-20e1-55af-4e12e8cdda2c@yandex.ru> <1191195d-1528-dc2a-64e0-15426e4b5608@yandex.ru> From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 60321 Cc: 60321@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.9 (-) On 26/12/2022 01:46, Aaron Jensen wrote: > enh-ruby-mode and vim do the same thing, which I think is fine: > > takes_multi_pairs_hash(x: { > a: 1, > b: 2 > }) Makes sense to me, I just wanted to keep this case in the bug report because it will likely need a separate indentation rule or a separate clause. >> and_in_a_method_call({ >> no: :difference >> }, >> foo, >> bar) > > enh-ruby-mode: > > and_in_a_method_call({ > no: :difference > }, > foo, > bar) > > > Vim: > > and_in_a_method_call({ > no: :difference > }, > foo, > bar) Vim's choice looks saner to my eye. Probably comes down to the choice of indentation algorithm, though. > I think this falls under something I wouldn't put too much effort into > fixing. I would write it like this: > > and_in_a_method_call( > { > no: :difference > }, > foo, > bar > ) > > Which indents in a straightforward manner. Indeed. But this works already, no changes required. > If I had to type it as above, I would probably indent it like this: > > and_in_a_method_call({ > no: :difference > }, > foo, > bar) > > But I can't imagine that would be easy to implement at all, so I > wouldn't bother. The indentation logic itself might be not that difficult to write, but the fact that the expression will have to be reindented as soon as the method call grows a second argument (after the user types the comma?), makes it a hard sell usability-wise. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 26 20:38:23 2022 Received: (at 60321) by debbugs.gnu.org; 27 Dec 2022 01:38:23 +0000 Received: from localhost ([127.0.0.1]:54401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9yv8-0000dI-Uc for submit@debbugs.gnu.org; Mon, 26 Dec 2022 20:38:23 -0500 Received: from mail-pf1-f180.google.com ([209.85.210.180]:42801) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9yv6-0000d4-Ru for 60321@debbugs.gnu.org; Mon, 26 Dec 2022 20:38:21 -0500 Received: by mail-pf1-f180.google.com with SMTP id 65so8038373pfx.9 for <60321@debbugs.gnu.org>; Mon, 26 Dec 2022 17:38:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=gzqil5gDqWHnl76ZxfppUAYj0jRao6Z1FEDcEOZdqXE=; b=CRTOgt+p6ufFHiO5KXbelNge+PEpYwbKDVWN+xi9Z+WZcyjkbFYlL/GdIkwq1UuuSx +hCxWy+q9ZV2/NuxNSFuZnNPFiP9eI3CXP+IcN4u2xDRmVPX4URQDxE9wz8tf4gAHc8I /u0Hzz3liomMev+jvE3n0msR4FLIFvN+bgDLnEZQNBKoggeTlHXCetTeiYr/RrJSyUAf w4kEfU0P73wNQSWNSMxGidmcgyC1JtEX1uwGQJ4daPI9SHbMSqX1SYelZEx7BGLW0b+E fHD3x8cqOTde5Oc8eNhezNJ/V+5+ctvUl4YxRl5H2s71aksgpK2AT6Cso7pIh+QcOEe0 Z3/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=gzqil5gDqWHnl76ZxfppUAYj0jRao6Z1FEDcEOZdqXE=; b=BNYH2wwK+KvW1TQVEVzXpSxkVC6CG3aGr5eicjEsb04nEVTKlNuZ+KdVfL/hqfvPCt vp9JCSSYV3sN3e6wl33VxFxcYpbd4ee/4Zop0f/7AfcobwaTJ8Kg1rq/V/KnWrHrI33R D0lid0jRGgiGEn07h3w0isZ6th/+foM0Gz5sNrh3XkGTki2oNdmPu6Q3u/WgED82CWNz Ws+K8gO8k4gkEtlCqb6KhCruNSCPBlx8uA/31SBK2hVApZltom/UytaCOklVDLvb+aIF TCMW/lyLxPvkKiwP2ohLUA0SyNg6Fmhm70xtMgq2oy54GRx7M8908NXgnbwYfwQKTBPZ +mYw== X-Gm-Message-State: AFqh2kphPLuokDpiUrMixe1jSMwx5aJ2eOj+sb1c+PJOVg7m/i9a95G4 LBBNBahiqH/ZsmhxoZ3XMLUbd7lLRJu5tX5mxzQ= X-Google-Smtp-Source: AMrXdXvaaPKgXlUEaQFwpXAdleaYEqFd8DWnEdJrKkrv5Aqvveh0gS/Ee8QTjvn34KoNesr/igvYt9TsuLiZZixd4Bg= X-Received: by 2002:a62:388d:0:b0:576:9786:94c2 with SMTP id f135-20020a62388d000000b00576978694c2mr1267302pfa.26.1672105094553; Mon, 26 Dec 2022 17:38:14 -0800 (PST) MIME-Version: 1.0 References: <4e44df18-207c-c7ca-0588-7285f3008dfb@yandex.ru> <358bbd65-9375-04c8-f0a2-24a4383f142e@yandex.ru> <2b4a91e1-bad1-382f-dd64-abf171efb404@yandex.ru> <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> In-Reply-To: <75342f40-d576-e1c6-3d63-692b80e78bfe@yandex.ru> From: Aaron Jensen Date: Mon, 26 Dec 2022 20:38:03 -0500 Message-ID: Subject: Re: bug#60321: 29.0.60; ruby-mode indentation of hash or array as first arg in multiline method call To: Dmitry Gutov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60321 Cc: 60321@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Mon, Dec 26, 2022 at 8:16 PM Dmitry Gutov wrote: > > Vim's choice looks saner to my eye. Probably comes down to the choice of > indentation algorithm, though. Agreed, though it's hard to pick which is more sane when all the options start with insanity. > > If I had to type it as above, I would probably indent it like this: > > > > and_in_a_method_call({ > > no: :difference > > }, > > foo, > > bar) > > > > But I can't imagine that would be easy to implement at all, so I > > wouldn't bother. > > The indentation logic itself might be not that difficult to write, but > the fact that the expression will have to be reindented as soon as the > method call grows a second argument (after the user types the comma?), > makes it a hard sell usability-wise. Right, I think that's just more of the same thing... We are looking at ways of writing code that are out of the realm of reason. It's a challenge to define behavior when the behavior could very well be undefined. But, if we must define it, then what are our guiding principles? Not having to reindent preceding lines when adding a new line may be a very reasonable one. In that case, the only two options I could think of would be: and_in_a_method_call({ no: :difference }, foo, bar) or and_in_a_method_call({ no: :difference }, foo, bar) The difference being if we decide to dedent upon the last closing indent-requiring-token or the first. I think a reasonable rule of thumb for a human might be: "If you open N indents on one line, you must close N indents on one line". Any time you stray away from this, behavior becomes... not ideal. Aaron From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 24 00:48:21 2024 Received: (at control) by debbugs.gnu.org; 24 Jul 2024 04:48:21 +0000 Received: from localhost ([127.0.0.1]:32975 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sWTvI-0002JH-MH for submit@debbugs.gnu.org; Wed, 24 Jul 2024 00:48:20 -0400 Received: from mail-ed1-f49.google.com ([209.85.208.49]:46119) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sWTvG-0002Iz-E3 for control@debbugs.gnu.org; Wed, 24 Jul 2024 00:48:19 -0400 Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-5a10bb7b237so6130590a12.0 for ; Tue, 23 Jul 2024 21:48:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721796427; x=1722401227; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=6w0llrYx7mR9S7mwSy3WOgVZoIXzqhMVdgHbsSiL37I=; b=R6dCPtwUkBln5H2WbCM+DM2oPEePlevaSeAb60wjIjr73+iPbQu6uaeOriZtNB/ryZ mo+edm5/wF8x5oAckjQYTwlmnIle8fI4/R6t1P71Z7hUZ4CqDkaVmBBL20gomaEBmcdu sMcV40m4AkMYxA1Q4gW3M4NSmCzzB4AMQiL0QWqDKC+i7qZ078VnmoObE+7x18uE6rng 0RpEY9SdlBGJpcnRHizqz0QrpWJmH9XUG9Fmio4PnDGcElky43azyYaVVcLBlK9YKlaG eomYqwqqIFwdshchsqXSig1pH7DtCzuEgE0knAQ5TCfX9SqKrt12UDz7J5/TYfrRDNTn y/Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721796427; x=1722401227; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6w0llrYx7mR9S7mwSy3WOgVZoIXzqhMVdgHbsSiL37I=; b=XyjNsq0aVnDHldiRKSB2gqt20DdG3EXDT/BjLBPl5sY+wTQQvXiQ4Jowy37QAKkLQd dOrk5OG7DW+0cZZkTY/Hzz2nLHcGEBcmcfV8eF/VLR3oD48aZGZb7yXJ/jb5JBdlAI2p j2tavXe+yaOltGR5cq3P2KsW4EYWa9Z+8ErVOLS6Y9kE4bk27ZiTkiNzftOVxBDwlSBM dvbmtC9/Ixo7ow/Z4G0UnGavJJPT+2uWCmTTqkT26AZGgIkmO4kVgzM2tY+xHt8/sPFk w7FGevdisYzQiBxcU92Dib0nzhcMHly2YO9RpCwCsbnSG5WfxI6b9WYBNLTPeo7eHl46 6Uag== X-Forwarded-Encrypted: i=1; AJvYcCX71M730nhPZKMwWkup/otv6ufmHSEDPMWa+Zoe2+dVfiq4CuhouaWBzkxZakqRotfpc7osF3vOUdTfn6oGB9ymQa+WDE42rQ== X-Gm-Message-State: AOJu0YzCXDEmV5iQYGl5/E+zefKnaCJd2SuNxAgLAQfUy7EKqCjorzbb KZ+CO2o1g3o9T96sFe0vyQVwZP/XPkCM28g1JRQ5hLJfX1Gjj9ig809e7bbDm35KmvLQFknozez tLtScRMVudDBqeIuZwXOvnNPT8l8= X-Google-Smtp-Source: AGHT+IGbFf4n1Et4Mmh3dnEKCDbfOprRXgsjkFbrhuH/RFbJNi3IV2wID7qxerT7X4UpXPOoicusbp2V8TlsaXceSvM= X-Received: by 2002:a05:6402:5193:b0:58d:81ac:ea90 with SMTP id 4fb4d7f45d1cf-5aaee8b740amr559728a12.38.1721796426845; Tue, 23 Jul 2024 21:47:06 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 23 Jul 2024 21:47:06 -0700 From: Stefan Kangas In-Reply-To: References: MIME-Version: 1.0 Date: Tue, 23 Jul 2024 21:47:06 -0700 Message-ID: Subject: Re: bug#72099: 31.0.50; ruby-mode indentation of inline array and hash arguments To: Aaron Jensen , 72099@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" Bcc: control@debbugs.gnu.org X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control Cc: Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) forcemerge 60321 72099 thanks Aaron Jensen writes: > I think this is actually a duplicate of bug#60321, I just found it. I'm therefore merging the bugs. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 31 19:43:58 2024 Received: (at 60321) by debbugs.gnu.org; 31 Aug 2024 23:43:58 +0000 Received: from localhost ([127.0.0.1]:58537 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1skXl7-0000l8-I7 for submit@debbugs.gnu.org; Sat, 31 Aug 2024 19:43:58 -0400 Received: from mail-lj1-f170.google.com ([209.85.208.170]:58826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1skXl4-0000kr-WF for 60321@debbugs.gnu.org; Sat, 31 Aug 2024 19:43:56 -0400 Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2f51e5f0656so33642351fa.1 for <60321@debbugs.gnu.org>; Sat, 31 Aug 2024 16:42:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725147710; x=1725752510; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:in-reply-to:from:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=LRXfbmF2Y+KjUJdOxySgbgDXMZFFFzHu/8LgtbH80OY=; b=lG5q4krPMfaov2b3rgWtTw/q7ETdkiq5b1ZCtvib6ya+7fSCJfXRmdfv6aAmP5BKVq 4okuAUh/5YPwL8b5PKQxFiEmzTsTO4aulOZdBuzEIpw28sPRA3hFk9MLrdkkIVgrqu33 TMmOUoX3LYWSKKuv+aGPugphrvzzFL9vbLxVq1kclkfUpeayA58F+pGvfN+NXFzkXvni CEoN9K2D9V19cQOZqH6i+eGBDYYo5+iha4wZCgJqdGh76mvLn09FnkmI6k4HSfu0IRsc zCNqUUfCcpZVyaWLX0WDAHx0WxCN3QhaseThjrMOdWYrme+GV0IjYAE3D+96GNWOmYIo 88Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725147710; x=1725752510; h=cc:to:subject:message-id:date:in-reply-to:from:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LRXfbmF2Y+KjUJdOxySgbgDXMZFFFzHu/8LgtbH80OY=; b=WVA5Y1Wt+0nFCOugrmdwJ1kK05eNnAf70arCB/ecQav7/BV0eKBgI3FwT73pxY/SH4 D85ZcPY2BfhThlBPhDZqZtT5dhoTcJz0An0VNCFdJbUFo92SqCcLJvzoRo+Qq58SgnJf +KaOuS32H/6fhc8BujvqJkb6iOZcoIgMWy4qv8bq5oeHIK0BZGqEEZM9Si7olPGkCpU0 ixGFkDLCrY8Zwpgta3hay0CIPuPEv91fliB2tvbK1Q1kF9frYuVgLk71EhrPUP5/5O6W UiX7VVmnN+8X0uqhx0f0a+3cozF4LKaykT+93abEIu690j2tGdt1lUPS4mBB6/e7S9CO n9IQ== X-Gm-Message-State: AOJu0YydmDU0x17BfeW+hT7Vu3hc8l+a4ZiQKCW3N5MIWzpruboQkarH DD4wN54LHFj8IhU9nvmVYIsWeKkKrBtsQFtileS4U+RE9uU/GHYSr9NC4L/HMVymX+zYUXiOEeH 1QyVoGnDx3H+6zzl+4577A1vyDYs= X-Google-Smtp-Source: AGHT+IEiuN3thOkjS7l7sx3ex6uLWMTGLQ7R4Pt94oQOYBYnkxw+1vEARTCXyU5AyAYDNCvhc5pqM2sfFk8/21X6tzQ= X-Received: by 2002:a05:651c:548:b0:2f4:3de7:ac4c with SMTP id 38308e7fff4ca-2f6103908d3mr86652211fa.8.1725147709546; Sat, 31 Aug 2024 16:41:49 -0700 (PDT) Received: from 649336022844 named unknown by gmailapi.google.com with HTTPREST; Sat, 31 Aug 2024 16:41:48 -0700 Mime-Version: 1.0 References: <4e44df18-207c-c7ca-0588-7285f3008dfb@yandex.ru> <358bbd65-9375-04c8-f0a2-24a4383f142e@yandex.ru> <2b4a91e1-bad1-382f-dd64-abf171efb404@yandex.ru> <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> From: Aaron Jensen X-Superhuman-Draft-ID: draft00bfe6058908090e In-Reply-To: X-Mailer: Superhuman Desktop (2024-08-30T19:05:53Z) X-Superhuman-ID: m0ise23d.2227bb24-d7b0-4645-8a2f-8415e928ee9c Date: Sat, 31 Aug 2024 16:41:48 -0700 Message-ID: Subject: Re: bug#60321: 29.0.60; ruby-mode indentation of hash or array as first arg in multiline method call To: Dmitry Gutov Content-Type: multipart/mixed; boundary="00000000000069c1cd06210340ae" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60321 Cc: 60321@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --00000000000069c1cd06210340ae Content-Type: multipart/alternative; boundary="00000000000069c1cc06210340ac" --00000000000069c1cc06210340ac Content-Type: text/plain; charset="UTF-8" I made an attempt at this (attached). It introduces a new variable: ruby-bracketed-args-indent It is set to t by default and the behavior will be as it was before this patch. If it is something other than t, it will cause enable indentation like this: update({ key => value, other_key: }, { key => value, other_key: }) update([ 1, 2 ], [ 3, 4 ]) It does not handle cases such as: some_method({ key: :value }, other_argument) It will indent other_argument to be aligned with the (. This could be elaborated further, but I contend that if people are formatting their code this way that they likely have rather idiosyncratic formatting requirements and they would be best left to do what they want manually. Thanks, Aaron On Mon, Dec 26, 2022 at 8:38 PM, Aaron Jensen wrote: > On Mon, Dec 26, 2022 at 8:16 PM Dmitry Gutov wrote: > > Vim's choice looks saner to my eye. Probably comes down to the choice of > indentation algorithm, though. > > Agreed, though it's hard to pick which is more sane when all the options > start with insanity. > > If I had to type it as above, I would probably indent it like this: > > and_in_a_method_call({ > no: :difference > }, > foo, > bar) > > But I can't imagine that would be easy to implement at all, so I wouldn't > bother. > > The indentation logic itself might be not that difficult to write, but the > fact that the expression will have to be reindented as soon as the method > call grows a second argument (after the user types the comma?), makes it a > hard sell usability-wise. > > Right, I think that's just more of the same thing... We are looking at > ways of writing code that are out of the realm of reason. It's a challenge > to define behavior when the behavior could very well be undefined. But, if > we must define it, then what are our guiding principles? Not having to > reindent preceding lines when adding a new line may be a very reasonable > one. In that case, the only two options I could think of would be: > > and_in_a_method_call({ > no: :difference > }, > foo, > bar) > > or > > and_in_a_method_call({ > no: :difference > }, > foo, > bar) > > The difference being if we decide to dedent upon the last closing > indent-requiring-token or the first. > > I think a reasonable rule of thumb for a human might be: "If you open N > indents on one line, you must close N indents on one line". Any time you > stray away from this, behavior becomes... not ideal. > > Aaron > --00000000000069c1cc06210340ac Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I made an attempt a= t this (attached). It introduces a new variable:

ruby-bracketed-args-indent

It is set to t b= y default and the behavior will be as it was before this patch.

If it is something other than t, it will cause enable ind= entation like this:

update({
=C2= =A0 key =3D> value,
=C2=A0 other_key:
}, {
=C2=A0 key =3D> value,
=C2=A0 other_key:
<= /div>
})

update([
=C2=A0 1,<= br>
=C2=A0 2
], [
=C2=A0 3,
=
=C2=A0 4
])

It d= oes not handle cases such as:

some_method({
=C2=A0 key: :valu= e
},
other_argument= )

It will i= ndent other_argument to be aligned with=C2=A0the (. This could be elaborate= d further, but I contend that if people are formatting their code this way = that they likely have rather idiosyncratic formatting=C2=A0requirements and= they would be best left to do what they want manually.

Thanks,=C2=A0


Aaron

=
On Mon, Dec 26, 2022 at 8:38 PM, Aaron = Jensen <aaronjensen@gmail.com> wrote:

On Mon, Dec 26, 202= 2 at 8:16 PM Dmitry Gutov <dguto= v@yandex.ru> wrote:

Vim's choice looks saner to my eye. Probably comes down to the choice o= f indentation algorithm, though.

Agreed, though it's hard to pick which is more sane when all the options start with insanity.

If I had to type it as above, I would probably indent it like this:

and_in_a_method_call({
no: :difference
},
foo,
bar)

But I can't imagine that would be easy to implement at all, so I wouldn't bother.

The indentation logic itself might be not that difficult to write, but the fact that the expression will have to be reindented as soon as the method call grows a second argument (after the user types the comma?), makes it a hard sell usability-wise.

Right, I think that's just more of the same thing... We are looking at ways of writing code that are out of the realm of reason. It's a challenge to define behavior when the behavior could very well be undefined. But, if we must define it, then what are our guiding principles? Not having to reindent preceding lines when adding a new line may be a very reasonable one. In that case, the only two options I could think of would be:

and_in_a_method_call({
no: :difference
},
foo,
bar)

or

and_in_a_method_call({
no: :difference
},
foo,
bar)

The difference being if we decide to dedent upon the last closing indent-requiring-token or the first.

I think a reasonable rule of thumb for a human might be: "If you open N indents on one line, you must close N indents on one line". Any time you stray away from this, behavior becomes... not ideal.

Aaron


--00000000000069c1cc06210340ac-- --00000000000069c1cd06210340ae 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 X-Attachment-Id: ffad75926378cb99_0.1 RnJvbSAzMmIxY2UyODE3ODNiOThhZDY0YjFk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YXRlKGFyZzEsIHsKKyAgZm9vOiAiYmFyIgorfSwgWworICAxLAorICAy CitdLCBhcmcyKQorCisjIExvY2FsIFZhcmlhYmxlczoKKyMgcnVieS1icmFja2V0ZWQtYXJncy1p bmRlbnQ6IG5pbAorIyBydWJ5LW1ldGhvZC1wYXJhbXMtaW5kZW50OiBuaWwKKyMgRW5kOgpkaWZm IC0tZ2l0IGEvdGVzdC9saXNwL3Byb2dtb2Rlcy9ydWJ5LW1vZGUtdGVzdHMuZWwgYi90ZXN0L2xp c3AvcHJvZ21vZGVzL3J1YnktbW9kZS10ZXN0cy5lbAppbmRleCAyYjg1MDZhN2FkYy4uYzljZGU3 OTFiYWEgMTAwNjQ0Ci0tLSBhL3Rlc3QvbGlzcC9wcm9nbW9kZXMvcnVieS1tb2RlLXRlc3RzLmVs CisrKyBiL3Rlc3QvbGlzcC9wcm9nbW9kZXMvcnVieS1tb2RlLXRlc3RzLmVsCkBAIC05OTIsNiAr OTkyLDcgQEAgInJ1YnktYmxvY2staW5kZW50LnJiIgogKHJ1YnktZGVmdGVzdC1pbmRlbnQgInJ1 YnktbWV0aG9kLWNhbGwtaW5kZW50LnJiIikKIChydWJ5LWRlZnRlc3QtaW5kZW50ICJydWJ5LW1l dGhvZC1wYXJhbXMtaW5kZW50LnJiIikKIChydWJ5LWRlZnRlc3QtaW5kZW50ICJydWJ5LXBhcmVu bGVzcy1jYWxsLWFyZ3VtZW50cy1pbmRlbnQucmIiKQorKHJ1YnktZGVmdGVzdC1pbmRlbnQgInJ1 YnktYnJhY2tldGVkLWFyZ3MtaW5kZW50LnJiIikKIAogKGVydC1kZWZ0ZXN0IHJ1YnktLXRlc3Qt Y2hhaW5lZC1pbmRlbnRhdGlvbiAoKQogICAod2l0aC10ZW1wLWJ1ZmZlcgotLSAKMi40Mi4xCgo= --00000000000069c1cd06210340ae-- From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 31 20:56:15 2024 Received: (at 60321) by debbugs.gnu.org; 1 Sep 2024 00:56:15 +0000 Received: from localhost ([127.0.0.1]:58851 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1skYt4-0002lq-QJ for submit@debbugs.gnu.org; Sat, 31 Aug 2024 20:56:15 -0400 Received: from mail-lj1-f169.google.com ([209.85.208.169]:51525) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1skYt1-0002lZ-Vv for 60321@debbugs.gnu.org; Sat, 31 Aug 2024 20:56:13 -0400 Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-2f50966c469so34302591fa.3 for <60321@debbugs.gnu.org>; Sat, 31 Aug 2024 17:55:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725152047; x=1725756847; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=cYepKd2G3hCcgUksE9VAqowxaMCOmUXjSGGOxG3o7Jo=; b=GkRN7uxa2yx58yKcOrI9mlTuaU3Qf8yz0lNDIoJqqEqU4SUt2XSiU3q9GzK2L8hnwm afiAlTvbMRT1CXwd7GqaWA6ydOziGvjo7iT19MUTm7Mtvj1WxG+nkgP5AtJ1PjT6bKKj /6bnUruAT6Qq+1VG+wmFPNPto1REEoJ0L3sWzPcomYShzDYamz3cN6fBsVqBY186x6ZE n/T3AIjsv2DoIFuwXyPZdGB7WFX7dEgTkmDLmN/X1va05JjCbgAKzdaqbx10oOLt2gYr 9SuMEg68HaWvKZfTeABq/pNOBA970k/OtC4b8lZACb+gED9egxjW8Xz79vsgVKRtMpMS /54g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725152047; x=1725756847; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cYepKd2G3hCcgUksE9VAqowxaMCOmUXjSGGOxG3o7Jo=; b=gYdK5+a8p+Xr0hf+2yheLVDckxZmv079tcrbzKxhowIA+aZ1gGyOioOy+AmOanewd1 6oUgSW5WVg/IjK+jWIvUEBJ9TNVcny9GaBLpNgb37NKGa/R30JjjXqMPJqO4VtyE29cZ BpK5o9aA6a8jTtqFHx6MVL4OG8AxPYfPZtByEsyCEyiji1ti9DSq8nldtBirmZQIfh54 tUod+zXkLwC8pLOXvD+KGhJthr77fXYDpL2Z5nwQtLxdHIEL8YA4eDMwjaUlkNgpOVlp IpTp74h48lZ2DCHCNSOyWWQ4eNVtH4iOKR2VGzDzD1EMAzXXjhJEV3OlM/hZzVtlRvzZ fa6Q== X-Gm-Message-State: AOJu0Yyyqk7RJ+RllCxXmm7OP0+D7DNCA4BF/auoJXJYD7DdFfwfHdbX L63ABe51E595dH/K0f0vLPgnSj1vbBed5FrBw7xr0o1V2nlRIomosCwbmSyfJa1n50mwCdTH9c3 q3RZahRPsOURiBn3fjRCFedMj2UE= X-Google-Smtp-Source: AGHT+IE3vrJyzW3q5WnOy+56BEO869626MUDKYxnn0zEUms7cQy6SzSqgDfBKam15I2i3deExVQcYok/Gtkgw1NSVIc= X-Received: by 2002:a05:651c:221f:b0:2ef:2f9e:dd1b with SMTP id 38308e7fff4ca-2f6290400c5mr20801171fa.14.1725152046551; Sat, 31 Aug 2024 17:54:06 -0700 (PDT) Received: from 649336022844 named unknown by gmailapi.google.com with HTTPREST; Sat, 31 Aug 2024 17:54:05 -0700 Mime-Version: 1.0 X-Superhuman-Draft-ID: draft004d1b0b67d5cb9c In-Reply-To: References: <4e44df18-207c-c7ca-0588-7285f3008dfb@yandex.ru> <358bbd65-9375-04c8-f0a2-24a4383f142e@yandex.ru> <2b4a91e1-bad1-382f-dd64-abf171efb404@yandex.ru> <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> X-Mailer: Superhuman Desktop (2024-08-30T19:05:53Z) X-Superhuman-ID: m0iuz15s.7750ee11-3d61-4365-933f-bd4e4dd1aeb4 From: Aaron Jensen Date: Sat, 31 Aug 2024 17:54:05 -0700 Message-ID: Subject: Re: bug#60321: 29.0.60; ruby-mode indentation of hash or array as first arg in multiline method call To: Dmitry Gutov Content-Type: multipart/mixed; boundary="000000000000eb2fac0621044239" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60321 Cc: 60321@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000eb2fac0621044239 Content-Type: multipart/alternative; boundary="000000000000eb2fa90621044237" --000000000000eb2fa90621044237 Content-Type: text/plain; charset="UTF-8" Updated patch with more precise variables in the new test. Aaron On Sat, Aug 31, 2024 at 7:41 PM, Aaron Jensen wrote: > I made an attempt at this (attached). It introduces a new variable: > > ruby-bracketed-args-indent > > It is set to t by default and the behavior will be as it was before this > patch. > > If it is something other than t, it will cause enable indentation like > this: > > update({ > key => value, > other_key: > }, { > key => value, > other_key: > }) > > update([ > 1, > 2 > ], [ > 3, > 4 > ]) > > It does not handle cases such as: > > some_method({ > key: :value > }, > other_argument) > > It will indent other_argument to be aligned with the (. This could be > elaborated further, but I contend that if people are formatting their code > this way that they likely have rather idiosyncratic formatting requirements > and they would be best left to do what they want manually. > > Thanks, > > > Aaron > > > On Mon, Dec 26, 2022 at 8:38 PM, Aaron Jensen > wrote: > > On Mon, Dec 26, 2022 at 8:16 PM Dmitry Gutov wrote: > > Vim's choice looks saner to my eye. Probably comes down to the choice of > indentation algorithm, though. > > Agreed, though it's hard to pick which is more sane when all the options > start with insanity. > > If I had to type it as above, I would probably indent it like this: > > and_in_a_method_call({ > no: :difference > }, > foo, > bar) > > But I can't imagine that would be easy to implement at all, so I wouldn't > bother. > > The indentation logic itself might be not that difficult to write, but the > fact that the expression will have to be reindented as soon as the method > call grows a second argument (after the user types the comma?), makes it a > hard sell usability-wise. > > Right, I think that's just more of the same thing... We are looking at > ways of writing code that are out of the realm of reason. It's a challenge > to define behavior when the behavior could very well be undefined. But, if > we must define it, then what are our guiding principles? Not having to > reindent preceding lines when adding a new line may be a very reasonable > one. In that case, the only two options I could think of would be: > > and_in_a_method_call({ > no: :difference > }, > foo, > bar) > > or > > and_in_a_method_call({ > no: :difference > }, > foo, > bar) > > The difference being if we decide to dedent upon the last closing > indent-requiring-token or the first. > > I think a reasonable rule of thumb for a human might be: "If you open N > indents on one line, you must close N indents on one line". Any time you > stray away from this, behavior becomes... not ideal. > > Aaron > > --000000000000eb2fa90621044237 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Updated patch with = more precise variables in the new test.


Aaron


On Sat, Aug 31, 2024 at 7:41 PM, Aaron Jensen <= aaronjensen@gmail.com> wrote:
I made an attempt at this (attached). It introduces a new varia= ble:

ruby-bracketed-args-indent

It is set to t by default and the behavior will be as it was before this= patch.

If it is something other than t, it will caus= e enable indentation like this:

update({
=C2=A0 key =3D> value,
=C2=A0 other_key:
}, {
=C2=A0 key =3D> value,
=C2=A0 other_key:
})
=

update([
=C2=A0 1,
=C2=A0 2
], [
=C2=A0 3,
])

It does not handle cases such as:

some_metho= d({
=C2=A0 key: :value
},
other_argument)

It will indent other_argument to= be aligned with=C2=A0the (. This could be elaborated further, but I conten= d that if people are formatting their code this way that they likely have r= ather idiosyncratic formatting=C2=A0requirements and they would be best lef= t to do what they want manually.

Thanks,=C2=A0=


Aaron


On Mon, Dec 26, = 2022 at 8:38 PM, Aaron Jensen <aaronjensen@= gmail.com> wrote:

On Mon, Dec 26, 2022 at 8:16 PM Dmitry Gutov <dgutov@yandex.ru> wrote:

Vim's choice looks saner to my eye. Probably comes down to the choice o= f indentation algorithm, though.

Agreed, though it's hard to pick which is more sane when all the options start with insanity.

If I had to type it as above, I would probably indent it like this:

and_in_a_method_call({
no: :difference
},
foo,
bar)

But I can't imagine that would be easy to implement at all, so I wouldn't bother.

The indentation logic itself might be not that difficult to write, but the fact that the expression will have to be reindented as soon as the method call grows a second argument (after the user types the comma?), makes it a hard sell usability-wise.

Right, I think that's just more of the same thing... We are looking at ways of writing code that are out of the realm of reason. It's a challenge to define behavior when the behavior could very well be undefined. But, if we must define it, then what are our guiding principles? Not having to reindent preceding lines when adding a new line may be a very reasonable one. In that case, the only two options I could think of would be:

and_in_a_method_call({
no: :difference
},
foo,
bar)

or

and_in_a_method_call({
no: :difference
},
foo,
bar)

The difference being if we decide to dedent upon the last closing indent-requiring-token or the first.

I think a reasonable rule of thumb for a human might be: "If you open N indents on one line, you must close N indents on one line". Any time you stray away from this, behavior becomes... not ideal.

Aaron


--000000000000eb2fa90621044237-- --000000000000eb2fac0621044239 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 X-Attachment-Id: 66b3f9adc71b171d_0.1 RnJvbSAxYjU4MjZkZGE0ZmY4ZDAxNGQzN2Y5MGIyMjU2OWUzNzZkYjg1Mjk2IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBBYXJvbiBKZW5zZW4gPGFhcm9uamVuc2VuQGdtYWlsLmNvbT4K RGF0ZTogU2F0LCAzMSBBdWcgMjAyNCAxOTozMToyMCAtMDQwMApTdWJqZWN0OiBbUEFUQ0hdIEFk ZCBydWJ5IGJyYWNrZXRlZCBhcmd1bWVudCBpbmRlbnRhdGlvbiBvcHRpb24KCiogbGlzcC9wcm9n bW9kZXMvcnVieS1tb2RlLmVsIChydWJ5LWJyYWNrZXRlZC1hcmdzLWluZGVudCksCihydWJ5LXNt aWUtcnVsZXMpOiBOZXcg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9ydWJ5LW1vZGUtdGVzdHMuZWwKKysrIGIvdGVzdC9saXNwL3Byb2dtb2Rlcy9ydWJ5LW1v ZGUtdGVzdHMuZWwKQEAgLTk5Miw2ICs5OTIsNyBAQCAicnVieS1ibG9jay1pbmRlbnQucmIiCiAo cnVieS1kZWZ0ZXN0LWluZGVudCAicnVieS1tZXRob2QtY2FsbC1pbmRlbnQucmIiKQogKHJ1Ynkt ZGVmdGVzdC1pbmRlbnQgInJ1YnktbWV0aG9kLXBhcmFtcy1pbmRlbnQucmIiKQogKHJ1YnktZGVm dGVzdC1pbmRlbnQgInJ1YnktcGFyZW5sZXNzLWNhbGwtYXJndW1lbnRzLWluZGVudC5yYiIpCiso cnVieS1kZWZ0ZXN0LWluZGVudCAicnVieS1icmFja2V0ZWQtYXJncy1pbmRlbnQucmIiKQogCiAo ZXJ0LWRlZnRlc3QgcnVieS0tdGVzdC1jaGFpbmVkLWluZGVudGF0aW9uICgpCiAgICh3aXRoLXRl bXAtYnVmZmVyCi0tIAoyLjQyLjEKCg== --000000000000eb2fac0621044239-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 01 12:37:27 2024 Received: (at 60321) by debbugs.gnu.org; 1 Sep 2024 16:37:27 +0000 Received: from localhost ([127.0.0.1]:37952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sknZv-0005vn-5E for submit@debbugs.gnu.org; Sun, 01 Sep 2024 12:37:27 -0400 Received: from forward500a.mail.yandex.net ([178.154.239.80]:43732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sknZr-0005va-PM for 60321@debbugs.gnu.org; Sun, 01 Sep 2024 12:37:25 -0400 Received: from mail-nwsmtp-smtp-production-main-42.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-42.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:2997:0:640:e24c:0]) by forward500a.mail.yandex.net (Yandex) with ESMTPS id 940ED60EB3; Sun, 1 Sep 2024 19:36:20 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-42.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id Iacqp4No5Ko0-UoRUyHlt; Sun, 01 Sep 2024 19:36:19 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1725208580; bh=9NGF05AFy1ThM5pEw844etLJrCQsyecePE1PSBd2QZE=; h=In-Reply-To:From:Subject:Message-ID:Cc:References:Date:To; b=hhoISqcL3yTSPU5Vpchew0RP+2vAo2bKAHmUhr1akIKJlry5pMYcLemQpCV5o9vff ZL2Cyh0Wq0ICVmehRC4gAVTevm/hsbxbr8N4OK/uQqhhwj//O9HjHsLWQXw1+4r26T ShN5PYJQV8d/Biv/6w+8uKqGGRP54qWI+/sow5Q8= Authentication-Results: mail-nwsmtp-smtp-production-main-42.myt.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Received: from phl-compute-01.internal (phl-compute-01.nyi.internal [10.202.2.41]) by mailfauth.nyi.internal (Postfix) with ESMTP id EA63C1200043; Sun, 1 Sep 2024 12:36:17 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Sun, 01 Sep 2024 12:36:17 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudegjedguddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegughhuthhovheshigrnhguvgigrd hruheqnecuggftrfgrthhtvghrnhepiefhjeeuveetffffvdefteffffekhfeuudejieeh heeiudelgfehgffffeduffdunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepughguhhtohhvodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhi thihqddufeeffeelleehhedvqddvleegjeejjeejiedqughguhhtohhvpeephigrnhguvg igrdhruhesfhgrshhtmhgrihhlrdgtohhmpdhnsggprhgtphhtthhopedvpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopegrrghrohhnjhgvnhhsvghnsehgmhgrihhlrdgtoh hmpdhrtghpthhtohepiedtfedvudesuggvsggsuhhgshdrghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: ib1d9465d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 1 Sep 2024 12:36:16 -0400 (EDT) Message-ID: <90f8ce9c-4a60-4af9-8ed7-eeddff557129@yandex.ru> Date: Sun, 1 Sep 2024 19:36:15 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#60321: 29.0.60; ruby-mode indentation of hash or array as first arg in multiline method call To: Aaron Jensen References: <2b4a91e1-bad1-382f-dd64-abf171efb404@yandex.ru> <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> Content-Language: en-US From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60321 Cc: 60321@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Aaron! On 01/09/2024 03:54, Aaron Jensen wrote: > Updated patch with more precise variables in the new test. Thanks for taking the initiative. Here's an example which seems to get worse with the new variable set to nil: def foo foo.update( { key => value, other_key: foo } ) end I'd like to flip the default value (now or in Emacs 31), so it would be great to deal with examples like this. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 01 15:31:06 2024 Received: (at 60321) by debbugs.gnu.org; 1 Sep 2024 19:31:06 +0000 Received: from localhost ([127.0.0.1]:38934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1skqHy-0002rb-38 for submit@debbugs.gnu.org; Sun, 01 Sep 2024 15:31:06 -0400 Received: from mail-lj1-f174.google.com ([209.85.208.174]:46276) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1skqHw-0002qv-LC for 60321@debbugs.gnu.org; Sun, 01 Sep 2024 15:31:05 -0400 Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2f409c87b07so43388681fa.0 for <60321@debbugs.gnu.org>; Sun, 01 Sep 2024 12:30:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725218927; x=1725823727; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=JV1hNAAc15RZGGX7yVIl9BpIp8qd3pbhowJiZe0+mKg=; b=P6dovfe80p3IeiAX1gNvDYr6yWFLtjEXdQdr4Bp5d/7dWhs6KlecdhRGHnydc85/uy osSd0U2jiOlViEivXk3dtdfDH6pFNPC7Qt76rO2rCV8BroL8XO/NcIePOJfsep4q9+zq 84WO9N1utg4ACRwdSM7Ks1RzIpM7kLbUIPx+vW4j4rRnwBC4K9f3xKBPi04oh2q9Yj+Z cZIMkS8E3XLQxIoQRg35cp6PwrBdy5FuSZiX9DVE1LorbIih66V3YZ58uH0dHL6wWZCX TXaljwj2WZQM+g1Cc+yigiBRgnkpm0ioQvIebFLnmJnxTvBt/C2/2RwkGn/WgECVazLl Kx3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725218927; x=1725823727; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JV1hNAAc15RZGGX7yVIl9BpIp8qd3pbhowJiZe0+mKg=; b=vkWmOULaowJTaugpaSAMm1YPn48XVbEQHT4ojeCQ+Wic3+VUGP8ovGb0MZYiEUr7xe /zcQoE4JxVhdFgF3DalM2dRV16dEqJHhdSqN/Dx4+MrqgFdYrZr0vZ8MorVPX/6Sm3T9 DCQilvmFPSHTg+7Z/SabcQApHmE3mbFEx/Bqy0bPhn7Z0LKb7jQe+7p5YGG9RWd20ofx 1w5GBexqL5Xj2QqP11MbtROBtMByMqMfKlWjDu6t8LgwBm86qowPCzqRWnn+IVdcIH9b EvyyUlnawVFGonqGRFKj2WSG5nA1OgWrQ/GRHkSFqGjuMwJicYMoh7OmT7A5COHJV+kt 8rvw== X-Gm-Message-State: AOJu0YzSIRad2Fd44isM7JbIFdPFY/MPnk3M1uguK/PiXYEIfIUnxFUy SmXqafM+MT77o39157NHWXfceDD+eDnj2FqSPgdnhZ4jKc03iapA+r+N6C67QIqJivojASnx1Ux C0PcrMH2zUI8i60GE3PM9kgNUzMU= X-Google-Smtp-Source: AGHT+IHiqDtGQ80rDcB1DBEH6ttz2xqfvbbGM+AT3jEBpbunqqKZAHhO4K61Dyfstnx69CSfcrV4lyusMwJ/O6gDGhM= X-Received: by 2002:a2e:4e01:0:b0:2f1:a4a0:86a1 with SMTP id 38308e7fff4ca-2f62656bcaamr30308071fa.20.1725218926874; Sun, 01 Sep 2024 12:28:46 -0700 (PDT) Received: from 649336022844 named unknown by gmailapi.google.com with HTTPREST; Sun, 1 Sep 2024 12:28:45 -0700 Mime-Version: 1.0 X-Superhuman-ID: m0jysi9m.82494f5b-662a-4a44-8913-88339a95b45d In-Reply-To: <90f8ce9c-4a60-4af9-8ed7-eeddff557129@yandex.ru> References: <2b4a91e1-bad1-382f-dd64-abf171efb404@yandex.ru> <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> From: Aaron Jensen X-Mailer: Superhuman Desktop (2024-08-30T19:05:53Z) X-Superhuman-Draft-ID: draft0028b2782c71e95e Date: Sun, 1 Sep 2024 12:28:45 -0700 Message-ID: Subject: Re: bug#60321: 29.0.60; ruby-mode indentation of hash or array as first arg in multiline method call To: Dmitry Gutov Content-Type: multipart/mixed; boundary="0000000000004bee52062113d523" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60321 Cc: 60321@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000004bee52062113d523 Content-Type: multipart/alternative; boundary="0000000000004bee4e062113d521" --0000000000004bee4e062113d521 Content-Type: text/plain; charset="UTF-8" Hi Dmitry, 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. 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. Thanks, Aaron On Sun, Sep 01, 2024 at 12:36 PM, Dmitry Gutov wrote: > Hi Aaron! > > On 01/09/2024 03:54, Aaron Jensen wrote: > > Updated patch with more precise variables in the new test. > > Thanks for taking the initiative. > > Here's an example which seems to get worse with the new variable set to > nil: > > def foo > foo.update( > { > key => value, > other_key: foo > } > ) > end > > I'd like to flip the default value (now or in Emacs 31), so it would be > great to deal with examples like this. > --0000000000004bee4e062113d521 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Dmitry,

Here's a corrected patch for= that particular example. Thank you for finding that. I think I missed it b= ecause 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.=C2=A0

I didn&#= 39;t change the default. I wasn't sure if you wanted to change the defa= ults 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.

Thanks,


Aaron


On Sun, Sep 01, 2024 at 12:36 PM, Dmitry Gutov <dgutov@y= andex.ru> wrote:

Hi Aaron!

On 01/09/2024 03:54, Aaron Jensen wrote:

Updated patch with more precise variables in the new test.

Thanks for taking the initiative.

Here's an example which seems to get worse with the new variable set to= nil:

def foo
foo.update(
{
key =3D> value,
other_key: foo
}
)
end

I'd like to flip the default value (now or in Emacs 31), so it would be= =20 great to deal with examples like this.


--0000000000004bee4e062113d521-- --0000000000004bee52062113d523 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 X-Attachment-Id: 549608442fe6c10f_0.1 RnJvbSAxYzIwNGE4ODM0YzhlM2U1OTBmYjg1MTQzM2Q4NmExN2JjZmZkOWE0IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBBYXJvbiBKZW5zZW4gPGFhcm9uamVuc2VuQGdtYWlsLmNvbT4K RGF0ZTogU2F0LCAzMSBBdWcgMjAyNCAxOTozMToyMCAtMDQwMApTdWJqZWN0OiBbUEFUQ0hdIEFk ZCBydWJ5IGJyYWNrZXRlZCBhcmd1bWVudCBpbmRlbnRhdGlvbiBvcHRpb24KCiogbGlzcC9wcm9n bW9kZXMvcnVieS1tb2RlLmVsIChydWJ5LWJyYWNrZXRlZC1hcmdzLWluZGVudCksCihydWJ5LXNt aWUtcnVsZXMpOiBOZXcgb3B0aW9uCiogdGVzdC9saXNwL3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AgIk5vbi1uaWwgdG8gYWxp Z24gdGhlIGNvbnRlbnRzIG9mIGJyYWNrZXRlZCBhcmd1bWVudHMgd2l0aCB0aGUgYnJhY2tldHMu CisKK0V4YW1wbGU6CisKKyAgcXV4KHsKKyAgICAgICBmb28gPT4gYmFyCisgICAgIH0pCisKK1Nl dCBpdCB0byBuaWwgdG8gYWxpZ24gdG8gdGhlIGJlZ2lubmluZyBvZiB0aGUgc3RhdGVtZW50Ogor CisgIHF1eCh7CisgICAgZm9vID0+IGJhcgorICB9KQorCitPbmx5IGhhcyBlZmZlY3Qgd2hlbiBg cnVieS11c2Utc21pZScgaXMgdC4iCisgIDp0eXBlICdib29sZWFuCisgIDpzYWZlICdib29sZWFu cAorICA6dmVyc2lvbiAiMzEuMSIpCisKIChkZWZjdXN0b20gcnVieS1kZWVwLWFyZ2xpc3QgdAog ICAiRGVlcCBpbmRlbnQgbGlzdHMgaW4gcGFyZW50aGVzaXMgd2hlbiBub24tbmlsLgogQWxzbyBp Z25vcmVzIHNwYWNlcyBhZnRlciBwYXJlbnRoZXNpcyB3aGVuIGBzcGFjZScuCkBAIC04MjYsNiAr ODQ2LDEwIEBAIHJ1Ynktc21pZS1ydWxlcwogICAgICAgKSkKICAgICAoYCg6YmVmb3JlIC4gLChv ciAiKCIgIlsiICJ7IikpCiAgICAgIChjb25kCisgICAgICAoKGFuZCAobm90IChlcSBydWJ5LWJy YWNrZXRlZC1hcmdzLWluZGVudCB0KSkKKyAgICAgICAgICAgIChzbWllLXJ1bGUtcHJldi1wICIs IiAiKCIgIlsiKQorICAgICAgICAgICAgKHNtaWUtcnVsZS1oYW5naW5nLXApKQorICAgICAgIChj b25zICdjb2x1bW4gKGN1cnJlbnQtaW5kZW50YXRpb24pKSkKICAgICAgICgoYW5kIChlcXVhbCB0 b2tlbiAieyIpCiAgICAgICAgICAgICAobm90IChzbWllLXJ1bGUtcHJldi1wICIoIiAieyIgIlsi ICIsIiAiPT4iICI9IiAicmV0dXJuIiAiOyIg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W9kZXMvcnVieS1tb2RlLXRlc3Rz LmVsCisrKyBiL3Rlc3QvbGlzcC9wcm9nbW9kZXMvcnVieS1tb2RlLXRlc3RzLmVsCkBAIC05OTIs NiArOTkyLDcgQEAgInJ1YnktYmxvY2staW5kZW50LnJiIgogKHJ1YnktZGVmdGVzdC1pbmRlbnQg InJ1YnktbWV0aG9kLWNhbGwtaW5kZW50LnJiIikKIChydWJ5LWRlZnRlc3QtaW5kZW50ICJydWJ5 LW1ldGhvZC1wYXJhbXMtaW5kZW50LnJiIikKIChydWJ5LWRlZnRlc3QtaW5kZW50ICJydWJ5LXBh cmVubGVzcy1jYWxsLWFyZ3VtZW50cy1pbmRlbnQucmIiKQorKHJ1YnktZGVmdGVzdC1pbmRlbnQg InJ1YnktYnJhY2tldGVkLWFyZ3MtaW5kZW50LnJiIikKIAogKGVydC1kZWZ0ZXN0IHJ1YnktLXRl c3QtY2hhaW5lZC1pbmRlbnRhdGlvbiAoKQogICAod2l0aC10ZW1wLWJ1ZmZlcgotLSAKMi40Mi4x Cgo= --0000000000004bee52062113d523-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 01 20:20:53 2024 Received: (at 60321) by debbugs.gnu.org; 2 Sep 2024 00:20:53 +0000 Received: from localhost ([127.0.0.1]:41109 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1skuoP-0007Qo-1r for submit@debbugs.gnu.org; Sun, 01 Sep 2024 20:20:53 -0400 Received: from forward502a.mail.yandex.net ([178.154.239.82]:36072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1skuoL-0007QW-6O for 60321@debbugs.gnu.org; Sun, 01 Sep 2024 20:20:51 -0400 Received: from mail-nwsmtp-smtp-production-main-55.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-55.vla.yp-c.yandex.net [IPv6:2a02:6b8:c0f:604:0:640:5e0e:0]) by forward502a.mail.yandex.net (Yandex) with ESMTPS id 1C39060F7B; Mon, 2 Sep 2024 03:19:46 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-55.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id hJN0Jp3oDuQ0-U7FdkS5Y; Mon, 02 Sep 2024 03:19:45 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1725236385; bh=SjPMEElvFL5w3Q2PyNrDfPj9bel2V4E9tNWsfwIXoGY=; h=In-Reply-To:From:Message-ID:Cc:References:Date:Subject:To; b=dSGIaWCJ5WnTViUPvBujQAhZTgbOTLFkVIm9vjV2h10VnYcjAjAr04764xv7ablEU YjxR7ck4Z7XhG0+A18ER2z44qVY+2HlQChXwWxnYfr6BVQClgfYe94jgXKCLQMwfpn 3oJN2w9U6CHqdTbRkZQ2is3u9p0hw3YYuClbcXNE= Authentication-Results: mail-nwsmtp-smtp-production-main-55.vla.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Received: from phl-compute-01.internal (phl-compute-01.nyi.internal [10.202.2.41]) by mailfauth.nyi.internal (Postfix) with ESMTP id 7A44D120006A; Sun, 1 Sep 2024 20:19:43 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Sun, 01 Sep 2024 20:19:43 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudegledgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurheptgfkffggfgfuvfevfhfhjgesmhdtreertddvjeen ucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughguhhtohhvseihrghnuggvgidrrh huqeenucggtffrrghtthgvrhhnpeduleegvdejvdefgeffudelueeljeefvddtiedtffei udeltdeuleetgeejledtgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegughhuthhovhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihht hidqudeffeefleelheehvddqvdelgeejjeejjeeiqdgughhuthhovheppeihrghnuggvgi drrhhusehfrghsthhmrghilhdrtghomhdpnhgspghrtghpthhtohepvddpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtoheprggrrhhonhhjvghnshgvnhesghhmrghilhdrtghomh dprhgtphhtthhopeeitdefvdduseguvggssghughhsrdhgnhhurdhorhhg X-ME-Proxy: Feedback-ID: ib1d9465d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 1 Sep 2024 20:19:42 -0400 (EDT) Content-Type: multipart/mixed; boundary="------------eyl36NZCgEa2wrpY77x43Qq2" Message-ID: Date: Mon, 2 Sep 2024 03:19:40 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#60321: 29.0.60; ruby-mode indentation of hash or array as first arg in multiline method call To: Aaron Jensen 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> Content-Language: en-US From: Dmitry Gutov In-Reply-To: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60321 Cc: 60321@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------eyl36NZCgEa2wrpY77x43Qq2 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 ]) 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. 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). * Let's change the first example to this, for less ambiguity? foo .update({ key => value, other_key: }, { key => value, other_key: }) * 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. --------------eyl36NZCgEa2wrpY77x43Qq2 Content-Type: text/x-patch; charset=UTF-8; name="ruby-ts-bracketed-argument-indentation-option.diff" Content-Disposition: attachment; filename="ruby-ts-bracketed-argument-indentation-option.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVzL3J1YnktdHMtbW9kZS5lbCBiL2xpc3AvcHJv Z21vZGVzL3J1YnktdHMtbW9kZS5lbAppbmRleCA1ZjRlMTFlMGI0Yy4uYWRjZGYxNWM3YWQg MTAwNjQ0Ci0tLSBhL2xpc3AvcHJvZ21vZGVzL3J1YnktdHMtbW9kZS5lbAorKysgYi9saXNw L3Byb2dtb2Rlcy9ydWJ5LXRzLW1vZGUuZWwKQEAgLTg0Miw2ICs4NDIsMTYgQEAgcnVieS10 cy0tcGFyZW50LWNhbGwtb3ItYm9sCiAgICAgIDs7IE5vIHBhcmVuL2N1cmx5L2JyYWNlIGZv dW5kIG9uIHRoZSBzYW1lIGxpbmUuCiAgICAgICgoP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m9nbW9kZXMvcnVieS10cy1tb2RlLXRlc3RzLmVs CisrKyBiL3Rlc3QvbGlzcC9wcm9nbW9kZXMvcnVieS10cy1tb2RlLXRlc3RzLmVsCkBAIC0z MjYsNiArMzI2LDcgQEAgInJ1YnktYmxvY2staW5kZW50LnJiIgogKHJ1YnktdHMtZGVmdGVz dC1pbmRlbnQgInJ1YnktbWV0aG9kLWNhbGwtaW5kZW50LnJiIikKIChydWJ5LXRzLWRlZnRl c3QtaW5kZW50ICJydWJ5LW1ldGhvZC1wYXJhbXMtaW5kZW50LnJiIikKIChydWJ5LXRzLWRl ZnRlc3QtaW5kZW50ICJydWJ5LXBhcmVubGVzcy1jYWxsLWFyZ3VtZW50cy1pbmRlbnQucmIi KQorKHJ1YnktdHMtZGVmdGVzdC1pbmRlbnQgInJ1YnktYnJhY2tldGVkLWFyZ3MtaW5kZW50 LnJiIikKIAogKHByb3ZpZGUgJ3J1YnktdHMtbW9kZS10ZXN0cykKIAo= --------------eyl36NZCgEa2wrpY77x43Qq2-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 01 20:52:20 2024 Received: (at 60321) by debbugs.gnu.org; 2 Sep 2024 00:52:20 +0000 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 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 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) MIME-Version: 1.0 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> In-Reply-To: From: Aaron Jensen Date: Sun, 1 Sep 2024 20:49:58 -0400 Message-ID: Subject: Re: bug#60321: 29.0.60; ruby-mode indentation of hash or array as first arg in multiline method call To: Dmitry Gutov Content-Type: multipart/mixed; boundary="000000000000ae613b0621185220" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60321 Cc: 60321@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --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 RGF0ZTogU2F0LCAzMSBBdWcgMjAyNCAxOTozMToyMCAtMDQwMApTdWJqZWN0OiBbUEFUQ0hdIEFk ZCBydWJ5IGJyYWNrZXRlZCBhcmd1bWVudCBpbmRlbnRhdGlvbiBvcHRpb24KCiogbGlzcC9wcm9n bW9kZXMvcnVieS1tb2RlLmVsIChydWJ5LWJyYWNrZX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cnNpb24gIjI5LjEiKQogCiso ZGVmY3VzdG9tIHJ1YnktYnJhY2tldGVkLWFyZ3MtaW5kZW50IHQKKyAgIk5vbi1uaWwgdG8gYWxp Z24gdGhlIGNvbnRlbnRzIG9mIGJyYWNrZXRlZCBhcmd1bWVudHMgd2l0aCB0aGUgYnJhY2tldHMu CisKK0V4YW1wbGU6CisKKyAgcXV4KHsKKyAgICAgICBmb28gPT4gYmFyCisgICAgIH0pCisKK1Nl dCBpdCB0byBuaWwgdG8gYWxpZ24gdG8gdGhlIGxpbmUgd2l0aCB0aGUgb3BlbmluZyBicmFja2V0 OgorCisgIHF1eCh7CisgICAgZm9vID0+IGJhcgorICB9KQorCitPbmx5IGhhcyBlZmZlY3Qgd2hl biBgcnVieS11c2Utc21pZScgaXMgdC4iCisgIDp0eXBlICdib29sZWFuCisgIDpzYWZlICdib29s ZWFucAorICA6dmVyc2lvbiAiMzEuMSIpCisKIChkZWZjdXN0b20gcnVieS1kZWVwLWFyZ2xpc3Qg dAogICAiRGVlcCBpbmRlbnQgbGlzdHMgaW4gcGFyZW50aGVzaXMgd2hlbiBub24tbmlsLgogQWxz byBpZ25vcmVzIHNwYWNlcyBhZnRlciBwYXJlbnRoZXNpcyB3aGVuIGBzcGFjZScuCkBAIC04MjYs NiArODQ2LDEwIEBAIHJ1Ynktc21pZS1ydWxlcwogICAgICAgKSkKICAgICAoYCg6YmVmb3JlIC4g LChvciAiKCIgIlsiICJ7IikpCiAgICAgIChjb25kCisgICAgICAoKGFuZCAobm90IChlcSBydWJ5 LWJyYWNrZXRlZC1hcmdzLWluZGVudCB0KSkKKyAgICAgICAgICAgIChzbWllLXJ1bGUtcHJldi1w ICIsIiAiKCIgIlsiKQorICAgICAgICAgICAgKHNtaWUtcnVsZS1oYW5naW5nLXApKQorICAgICAg IChjb25zICdjb2x1bW4gKGN1cnJlbnQtaW5kZW50YXRpb24pKSkKICAgICAgICgoYW5kIChlcXVh bCB0b2tlbiAieyIpCiAgICAgICAgICAgIC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LXRlc3RzLmVs CmluZGV4IDJiODUwNmE3YWRjLi5jOWNkZTc5MWJhYSAxMDA2NDQKLS0tIGEvdGVzdC9saXNwL3By b2dtb2Rlcy9ydWJ5LW1vZGUtdGVzdHMuZWwKKysrIGIvdGVzdC9saXNwL3Byb2dtb2Rlcy9ydWJ5 LW1vZGUtdGVzdHMuZWwKQEAgLTk5Miw2ICs5OTIsNyBAQCAicnVieS1ibG9jay1pbmRlbnQucmIi CiAocnVieS1kZWZ0ZXN0LWluZGVudCAicnVieS1tZXRob2QtY2FsbC1pbmRlbnQucmIiKQogKHJ1 YnktZGVmdGVzdC1pbmRlbnQgInJ1YnktbWV0aG9kLXBhcmFtcy1pbmRlbnQucmIiKQogKHJ1Ynkt ZGVmdGVzdC1pbmRlbnQgInJ1YnktcGFyZW5sZXNzLWNhbGwtYXJndW1lbnRzLWluZGVudC5yYiIp CisocnVieS1kZWZ0ZXN0LWluZGVudCAicnVieS1icmFja2V0ZWQtYXJncy1pbmRlbnQucmIiKQog CiAoZXJ0LWRlZnRlc3QgcnVieS0tdGVzdC1jaGFpbmVkLWluZGVudGF0aW9uICgpCiAgICh3aXRo LXRlbXAtYnVmZmVyCi0tIAoyLjQyLjEKCg== --000000000000ae613b0621185220-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 01 21:26:55 2024 Received: (at 60321) by debbugs.gnu.org; 2 Sep 2024 01:26:55 +0000 Received: from localhost ([127.0.0.1]:41361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1skvqI-0002DT-U0 for submit@debbugs.gnu.org; Sun, 01 Sep 2024 21:26:55 -0400 Received: from forward500d.mail.yandex.net ([178.154.239.208]:51804) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1skvqF-0002DG-Ew for 60321@debbugs.gnu.org; Sun, 01 Sep 2024 21:26:53 -0400 Received: from mail-nwsmtp-smtp-production-main-85.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-85.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:e80:0:640:5426:0]) by forward500d.mail.yandex.net (Yandex) with ESMTPS id D019660C67; Mon, 2 Sep 2024 04:10:10 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-85.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id 8AORxg17LqM0-Jc6el04x; Mon, 02 Sep 2024 04:10:10 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1725239410; bh=pF6ekC/RmOA5lOBKBty2QLBb/LIGaEMRPnxWNobtRgY=; h=In-Reply-To:From:Subject:Message-ID:Cc:References:Date:To; b=OqvYDyn9I5rpU+nBf6LjCcMrIHjB/IZ5yIJg22gAN9W58MIHtZ2thv10J82yL4r1U 20z6JC7pL5xDt7Jn5nuMN/zoFhM3/W2ls5IX0ZlrZi0fV0GySYDuszci73ifpao/Iu F6IQQi5W6/Qs8vu9pMbFgAtcP3JZop+F2Lg1OUuY= Authentication-Results: mail-nwsmtp-smtp-production-main-85.iva.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Received: from phl-compute-02.internal (phl-compute-02.nyi.internal [10.202.2.42]) by mailfauth.nyi.internal (Postfix) with ESMTP id E618B1200070; Sun, 1 Sep 2024 21:10:07 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Sun, 01 Sep 2024 21:10:07 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudegledggeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegughhuthhovheshigrnhguvgigrd hruheqnecuggftrfgrthhtvghrnhepiefhjeeuveetffffvdefteffffekhfeuudejieeh heeiudelgfehgffffeduffdunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepughguhhtohhvodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhi thihqddufeeffeelleehhedvqddvleegjeejjeejiedqughguhhtohhvpeephigrnhguvg igrdhruhesfhgrshhtmhgrihhlrdgtohhmpdhnsggprhgtphhtthhopedvpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopegrrghrohhnjhgvnhhsvghnsehgmhgrihhlrdgtoh hmpdhrtghpthhtohepiedtfedvudesuggvsggsuhhgshdrghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: ib1d9465d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 1 Sep 2024 21:10:06 -0400 (EDT) Message-ID: <2345189c-0033-4357-841c-1a6c7bc51a3c@yandex.ru> Date: Mon, 2 Sep 2024 04:10:05 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#60321: 29.0.60; ruby-mode indentation of hash or array as first arg in multiline method call To: Aaron Jensen References: <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> Content-Language: en-US From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60321 Cc: 60321@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 02/09/2024 03:49, Aaron Jensen wrote: >> 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 seems to me that anything other than 0 spaces would look inconsistent with the first element (the hash), and its closing brace in particular. Anyway, it's not urgent and like you said in the first message, people formatting code this way might have other unusual requirements as well. >> * 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 in advance. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 01 22:10:14 2024 Received: (at 60321) by debbugs.gnu.org; 2 Sep 2024 02:10:15 +0000 Received: from localhost ([127.0.0.1]:41583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1skwWE-0004IT-JJ for submit@debbugs.gnu.org; Sun, 01 Sep 2024 22:10:14 -0400 Received: from mail-ej1-f51.google.com ([209.85.218.51]:56606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1skwTT-00049O-3k for 60321@debbugs.gnu.org; Sun, 01 Sep 2024 22:07:23 -0400 Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a80eab3945eso318692966b.1 for <60321@debbugs.gnu.org>; Sun, 01 Sep 2024 19:06:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725242717; x=1725847517; 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=SSWHyv5hZ456zh0laInXBqfgd4f16o91uOa/9o20pIM=; b=gWb3OkB+ouq5BIVmvS1L/lPaSgt7IFoeFIN/3ZGFcKQzcF+4gNfvDzkUYZlXylGjL1 qZ9TY/7MkI2ceHh05xIVW1rcrTLBx4Re8Qfqo0kvtrM0fWl4KTnK7KiAk240eqPTYRRI j5BPYs9tbvnwJK25kabONb1/OnJ3/4lC6PZ2ObWkXr9lXyKD1MVRSQnGsji9QqOOBldn cxicNhA0RelywFoMAYeCc2jq8fPBzhdCKnOK+hXUhmdrTchVF7zBCqPQKrzVjmzxs/xt LuyyLHFLmTRL1nkBXeEj2BYWt//svcJWIsAjVtp27muZ0wDotvjvLjsKXqhocXV9rWgA kXpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725242717; x=1725847517; 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=SSWHyv5hZ456zh0laInXBqfgd4f16o91uOa/9o20pIM=; b=M5m/KMKyKYq/an9YASpDW/H+OCCadN4umIBqb7Ewd0OjJQ2DkkKdOTjXDrg1wULB0s eO0naIZm1JxSkwhKQPaZuDx2CP3stQHedfzbNskpNvL/sKXDQS2preyHeOXZsfdHhkcr eMytLcEi5Q2549ZxZvM9J6MV3UGeW0PQcoG0LsrESvgM0Fg5IhElZkH0CwEW2bBrK//w gVrK6agS16W5sU3ST//duvI2rMFGnciVkU2LVxbx1br3Yh029v/EhB+ZShwIMnyjfBrA 2a001P03vtvIXVZKaeeDOrnAtpZYa3AqwnYe/laTRiXn8kDOHH6GsfLqTXo/QOdXn98T ktnw== X-Gm-Message-State: AOJu0Yy3y5nyTPVrujdMWdhNTFjH8t1+rhtkZzyhJSVm3aCApq/z7PPd f+yOExKtf/niRpY4+c2XSJW3ssR8ZkSHT0Itg1iqErZAPVSYx0eswvm5ozvJAy32mLr8OVYfAKb /giraMctlctvgM4sz+ukPJ/cg0xXL5w== X-Google-Smtp-Source: AGHT+IE1gzdy5CnJuGXLnp6bwUCIEr9fF8TURb6q8/151RDnoC6Vq7J8Yw/lpYQjw4xZfH+D/XtXv0Ix+mwNMEb7/tk= X-Received: by 2002:a2e:bc25:0:b0:2f5:c13:bd11 with SMTP id 38308e7fff4ca-2f61e0562b8mr60883941fa.17.1725242223484; Sun, 01 Sep 2024 18:57:03 -0700 (PDT) MIME-Version: 1.0 References: <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> <2345189c-0033-4357-841c-1a6c7bc51a3c@yandex.ru> In-Reply-To: <2345189c-0033-4357-841c-1a6c7bc51a3c@yandex.ru> From: Aaron Jensen Date: Sun, 1 Sep 2024 21:56:52 -0400 Message-ID: Subject: Re: bug#60321: 29.0.60; ruby-mode indentation of hash or array as first arg in multiline method call To: Dmitry Gutov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60321 Cc: 60321@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > It seems to me that anything other than 0 spaces would look inconsistent > with the first element (the hash), and its closing brace in particular. Yeah, that's my sense as well, even if it looks awful, but you get what you get. > >> * 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 in advance. I installed it and gave it a run on a few things. I didn't observe any issues with it. Aaron From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 02 15:02:48 2024 Received: (at 60321-done) by debbugs.gnu.org; 2 Sep 2024 19:02:48 +0000 Received: from localhost ([127.0.0.1]:52404 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slCK8-0001rB-B4 for submit@debbugs.gnu.org; Mon, 02 Sep 2024 15:02:48 -0400 Received: from forward501d.mail.yandex.net ([178.154.239.209]:46756) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slCK5-0001qo-Tz for 60321-done@debbugs.gnu.org; Mon, 02 Sep 2024 15:02:47 -0400 Received: from mail-nwsmtp-smtp-production-main-19.klg.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-19.klg.yp-c.yandex.net [IPv6:2a02:6b8:c42:3143:0:640:c03:0]) by forward501d.mail.yandex.net (Yandex) with ESMTPS id E882F60CB1; Mon, 2 Sep 2024 22:01:11 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-19.klg.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id 91gGFN0TkiE0-IBXNJRe6; Mon, 02 Sep 2024 22:01:11 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1725303671; bh=I5HrfIr7bGXVgh9s+7loUI9YBw52v0eCyis/0SpA90E=; h=In-Reply-To:From:Subject:Message-ID:Cc:References:Date:To; b=nL+itK7/zEpDknEAO2wYyGq4eYOXOd7NrFRpWnLL62vdOoYJMParaCGn2fBqYcWqM iV2RCaY5SgkAhuiF3+J+mMn1+pGW0yyvZEyOW73jp4mcpZSN2M6Z641iDL1xm/jZYc 9QpUlU+FAUeRzuiPDVVX7uMQ7tgKEcVWR1Nx0LC8= Authentication-Results: mail-nwsmtp-smtp-production-main-19.klg.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Received: from phl-compute-03.internal (phl-compute-03.nyi.internal [10.202.2.43]) by mailfauth.nyi.internal (Postfix) with ESMTP id 50D4E120006A; Mon, 2 Sep 2024 15:01:09 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Mon, 02 Sep 2024 15:01:09 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudehfedgudefvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddv jeenucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughguhhtohhvseihrghnuggvgi drrhhuqeenucggtffrrghtthgvrhhnpeeihfejueevteffffdvfeetffffkefhuedujeei heehiedulefghefgffefudffudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpegughhuthhovhdomhgvshhmthhprghuthhhphgvrhhsohhnrghl ihhthidqudeffeefleelheehvddqvdelgeejjeejjeeiqdgughhuthhovheppeihrghnug gvgidrrhhusehfrghsthhmrghilhdrtghomhdpnhgspghrtghpthhtohepvddpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtoheprggrrhhonhhjvghnshgvnhesghhmrghilhdrtg homhdprhgtphhtthhopeeitdefvdduqdguohhnvgesuggvsggsuhhgshdrghhnuhdrohhr gh X-ME-Proxy: Feedback-ID: ib1d9465d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 2 Sep 2024 15:01:08 -0400 (EDT) Message-ID: <79c2bec9-ceea-4bca-834e-245a9f2c756a@yandex.ru> Date: Mon, 2 Sep 2024 22:01:05 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#60321: 29.0.60; ruby-mode indentation of hash or array as first arg in multiline method call To: Aaron Jensen References: <1191195d-1528-dc2a-64e0-15426e4b5608@yandex.ru> <75342f40-d576-e1c6-3d63-692b80e78bfe@yandex.ru> <90f8ce9c-4a60-4af9-8ed7-eeddff557129@yandex.ru> <2345189c-0033-4357-841c-1a6c7bc51a3c@yandex.ru> Content-Language: en-US From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60321-done Cc: 60321-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 02/09/2024 04:56, Aaron Jensen wrote: >> It seems to me that anything other than 0 spaces would look inconsistent >> with the first element (the hash), and its closing brace in particular. > Yeah, that's my sense as well, even if it looks awful, but you get what you get. > >>>> * 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 in advance. > I installed it and gave it a run on a few things. I didn't observe any > issues with it. Great! I've pushed both patches to emacs-30 (6c15b7710d4 and 24f12bdd77e) and now marking the issue as done. Thanks again for the patch. To summarize for future readers: the default behavior doesn't change - at least not now - you need to customize the option for different indentation. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 02 15:23:36 2024 Received: (at 60321-done) by debbugs.gnu.org; 2 Sep 2024 19:23:36 +0000 Received: from localhost ([127.0.0.1]:52498 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slCeG-0002eA-8w for submit@debbugs.gnu.org; Mon, 02 Sep 2024 15:23:36 -0400 Received: from mail-lj1-f170.google.com ([209.85.208.170]:46589) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slCeE-0002dq-52 for 60321-done@debbugs.gnu.org; Mon, 02 Sep 2024 15:23:34 -0400 Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2f43de7ad5eso58565941fa.1 for <60321-done@debbugs.gnu.org>; Mon, 02 Sep 2024 12:22:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725304887; x=1725909687; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:in-reply-to:from:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=95vO/2qFIsv/8vdacvUlZ05mhkWPXRotUg4ccKSRloY=; b=aeabzOTWW3dhLkNn53TlcoZw3oIvJ6a3M99bB4sU/FPfxliH7W9ZYXWN4a+x1lT6Hv cUgpKxirH/F6ZwXHaTxAiXEZQxD3rut9SBG6+PGoY+UH0W5Nu9TrnCwKtbuvsCOEWsMN F8ys7Be8p7wodi3mQqaOaOe8pqRB4FeyCcqpV5VvG55QTsoXeejPQK6KdJDXkAaKwdFD EHB8RN+9JWctsrWCv8pZ/UfElpYWAHVkQ/IgMREjdvz3C6sBA0JQPBpv4dOKFFnGKlPO YS4vO1HUjo1c66EQIVZUINXRaz7Z2PrraFp9e3K3GSQzut2fAot3barRrXOAICFMGRLb pXFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725304887; x=1725909687; h=cc:to:subject:message-id:date:in-reply-to:from:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=95vO/2qFIsv/8vdacvUlZ05mhkWPXRotUg4ccKSRloY=; b=ue04gpmTNAUa8DiowlHUcOEq9Gx80t9xgspzzYzzLkjfA+6LPgCQv9yZyIOO1FeBDK P2philk7qFOol6+B2VLQeYiAkOMeONhh0A2nm+Pz6zEHdK56ppu6xyTj2JClBtGQKk87 +DC0MC4NMZX1pMUec5ZRs5MTeN3Sgeu+3yc1qjd9WIFx1pi9slkeXZ1whVX6APw5sy0X hpyl++RaBQfDafHvmvy4Ahm6oJ1/PikdLccN8/wqFS9Qkv1ZrckubPYbWFyqGHy9wkgo JSSP88zHE6NQLLLSjqZvpBm8LVwfbVgeAz/Tvi6bBFruYTY+sJSkn5/Cl7+EfG15NQfW NJuA== X-Gm-Message-State: AOJu0YzisOpys3HwbIa+8sccNpgDVqlJTCFCiPR4cyEMcUoKpRwrtoaA kY3KWQqSkdB84fmZziCSWyDjsO1hKJAi/xhyVd2a5xpnQ0/YK9wLvFVeGOcxFY9/eKKJfppqbzu bUZJ8HspBTecjr5KMCpcdQ8sQ0CI= X-Google-Smtp-Source: AGHT+IH3TVojiZr+2GRsXQQ7SdrqkxmxWDLu3mu0UhIFtDOhdpRspCfkyMz14+mqFIwLIMDfsUKtFbUhJK5n/mlXYuQ= X-Received: by 2002:a05:651c:b0d:b0:2ef:268a:a194 with SMTP id 38308e7fff4ca-2f6265506e5mr61080151fa.9.1725304886259; Mon, 02 Sep 2024 12:21:26 -0700 (PDT) Received: from 649336022844 named unknown by gmailapi.google.com with HTTPREST; Mon, 2 Sep 2024 12:21:25 -0700 Mime-Version: 1.0 References: <1191195d-1528-dc2a-64e0-15426e4b5608@yandex.ru> <75342f40-d576-e1c6-3d63-692b80e78bfe@yandex.ru> <90f8ce9c-4a60-4af9-8ed7-eeddff557129@yandex.ru> <2345189c-0033-4357-841c-1a6c7bc51a3c@yandex.ru> <79c2bec9-ceea-4bca-834e-245a9f2c756a@yandex.ru> From: Aaron Jensen In-Reply-To: <79c2bec9-ceea-4bca-834e-245a9f2c756a@yandex.ru> X-Superhuman-Draft-ID: draft00b96d9d6114c147 X-Mailer: Superhuman iOS 11385 X-Superhuman-ID: m0ldyxoe.7b5f592c-c3a2-43b3-82d7-0ed2e1962511 Date: Mon, 2 Sep 2024 12:21:25 -0700 Message-ID: Subject: Re: bug#60321: 29.0.60; ruby-mode indentation of hash or array as first arg in multiline method call To: Dmitry Gutov Content-Type: multipart/alternative; boundary="000000000000dff936062127d880" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60321-done Cc: 60321-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000dff936062127d880 Content-Type: text/plain; charset="UTF-8" Thank you, and thanks for your help. Aaron On Mon, Sep 2 2024 at 3:01 PM, Dmitry Gutov wrote: > On 02/09/2024 04:56, Aaron Jensen wrote: > > It seems to me that anything other than 0 spaces would look inconsistent > with the first element (the hash), and its closing brace in particular. > > Yeah, that's my sense as well, even if it looks awful, but you get what > you get. > > * 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 in advance. > > I installed it and gave it a run on a few things. I didn't observe any > issues with it. > > Great! > > I've pushed both patches to emacs-30 (6c15b7710d4 and 24f12bdd77e) and now > marking the issue as done. Thanks again for the patch. > > To summarize for future readers: the default behavior doesn't change - at > least not now - you need to customize the option for different indentation. > --000000000000dff936062127d880 Content-Type: text/html; charset="UTF-8"
Thank you, and thanks for your help.


Aaron

On Mon, Sep 2 2024 at 3:01 PM, Dmitry Gutov <dgutov@yandex.ru> wrote:

On 02/09/2024 04:56, Aaron Jensen wrote:

It seems to me that anything other than 0 spaces would look inconsistent with the first element (the hash), and its closing brace in particular.

Yeah, that's my sense as well, even if it looks awful, but you get what you get.

* 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 in advance.

I installed it and gave it a run on a few things. I didn't observe any issues with it.

Great!

I've pushed both patches to emacs-30 (6c15b7710d4 and 24f12bdd77e) and now marking the issue as done. Thanks again for the patch.

To summarize for future readers: the default behavior doesn't change - at least not now - you need to customize the option for different indentation.

--000000000000dff936062127d880-- From unknown Mon Aug 18 14:23:43 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 02 Oct 2024 11:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator