From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#60186: 29.0.60; ruby-mode indentation of multi-line expressions Date: Sun, 25 Dec 2022 23:23:45 +0200 Message-ID: <154f41d0-c491-b105-d622-3c7d7203f37b@yandex.ru> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21261"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Cc: aaronjensen@gmail.com To: 60186@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 25 22:24:19 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p9YTi-0005PU-H5 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Dec 2022 22:24:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p9YTU-00058F-BE; Sun, 25 Dec 2022 16:24:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p9YTT-000587-2O for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 16:24:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p9YTS-0005oM-PA for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 16:24:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p9YTS-0002SP-KW; Sun, 25 Dec 2022 16:24:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: aaronjensen@gmail.com, bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Dec 2022 21:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60186 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: aaronjensen@gmail.com Original-Received: via spool by submit@debbugs.gnu.org id=B.16720034369427 (code B ref -1); Sun, 25 Dec 2022 21:24:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Dec 2022 21:23:56 +0000 Original-Received: from localhost ([127.0.0.1]:50194 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9YTM-0002Ry-Aw for submit@debbugs.gnu.org; Sun, 25 Dec 2022 16:23:56 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:39334) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9YTK-0002Rp-NS for submit@debbugs.gnu.org; Sun, 25 Dec 2022 16:23:55 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p9YTK-00056F-Bb for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 16:23:54 -0500 Original-Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p9YTG-0005m2-8N for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 16:23:53 -0500 Original-Received: by mail-wm1-x329.google.com with SMTP id h12so5430492wmq.0 for ; Sun, 25 Dec 2022 13:23:49 -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:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=biVmtjKU704x33B4e642+tkM8mwdk9FyxeHj7GEFg/0=; b=iueQWzTk29zUf5ZYiHo0fiqjjTPpXABJJQMF3hmI2R8A8f9L9gFxr0laSELdHeAe1A wHd7yrYCVWHAvDptJBoREvDrBYPnPw2AVr2Jq3u/iwluHO6HYQG35+THhYGn9RJqN5Mu BXjYQLdhws9D9LCsJHNX6Xz2yIEq92a/v3bAF77m60mlZCBqQKP/2/kmZs6BC82S4zay 8ewYzDnuU22/tGJJwncIYHUfy423omdpQrErY6W4Tc2iRrkUkFGfOrK1s2oUaMBhdqjg 9FUXX9BHRFiDerplLi+pgtj0rvncw21p6/Syij5AbICP4xItPacDB4Hd1qwfqJ7ueNz6 WTrw== 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: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=biVmtjKU704x33B4e642+tkM8mwdk9FyxeHj7GEFg/0=; b=ZA4xvx/VbWsLtVyS43HU2n0A8rgOjuKhc4cKDpOiXB2jHnxDAvd8u1kSbUCh0oyhtn sNztyb31aRmyYAWX1xdiEHB6fFqC4V8NaEGz6QZRxnPqzD/jY0uIIAGMHcxnL/1A/Pqj 2jGqYYt4Tyu2Bo3mmfmrH6E3hmOeGYzyIYgoZvZjxLx42d+HCcJMHdYNKyGgEqn04kK+ Uxfjs6tIkwcJa5d5i5m97jtEsaEypShHlJO658U1Y51S/Ee9iq9gGhW4rqpTPUaFbsiu Ra9G864mAFEo3dlK1TLEUo+IDEvoNqWDlgKmldi8Vtqy4t2SHcFdTjFxIRA62DNqcuR1 vrig== X-Gm-Message-State: AFqh2kpc+7prUQUm35zig6xgj7cIepdSgz0CMHoubyh0N5FQitI0wJoP jBnFpASb1qfHFzBYOn8lQp57H+dCHpw= X-Google-Smtp-Source: AMrXdXuwQabCIgrqJXpEvbUz8fWHV65/KFM4wwmnjhSX7mapqb+aKs+UqdllR+mspBxs9fk+Xs3F6A== X-Received: by 2002:a05:600c:3d92:b0:3d3:59a8:252d with SMTP id bi18-20020a05600c3d9200b003d359a8252dmr14114405wmb.9.1672003427636; Sun, 25 Dec 2022 13:23:47 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id m4-20020a05600c3b0400b003c6b7f5567csm29415413wms.0.2022.12.25.13.23.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 25 Dec 2022 13:23:46 -0800 (PST) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=raaahh@gmail.com; helo=mail-wm1-x329.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, NICE_REPLY_A=-1.148, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:251870 Archived-At: X-Debbugs-CC: aaronjensen@gmail.com Splitting off from debbugs#60186. Since this setting also seems orthogonal to the "simplified" preference, and it'll require some more work. 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.