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: Wed, 28 Dec 2022 01:04:45 +0200 Message-ID: <8d554fc2-7da5-cfe1-c865-023d56d222e3@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> <688159e9-f6bc-f233-08c4-9834bc00c455@yandex.ru> <74f977f6-d9ba-04bd-fba0-0dce4729cf0d@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="18453"; 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: 60186@debbugs.gnu.org To: Aaron Jensen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 28 00:05:22 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 1pAJ0b-0004eN-S0 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 28 Dec 2022 00:05:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pAJ0L-0000HY-4e; Tue, 27 Dec 2022 18:05:05 -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 1pAJ0I-0000HJ-PL for bug-gnu-emacs@gnu.org; Tue, 27 Dec 2022 18:05:02 -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 1pAJ0I-00033p-6W for bug-gnu-emacs@gnu.org; Tue, 27 Dec 2022 18:05:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pAJ0H-0001vy-Qx for bug-gnu-emacs@gnu.org; Tue, 27 Dec 2022 18:05:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Dec 2022 23:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60186 X-GNU-PR-Package: emacs Original-Received: via spool by 60186-submit@debbugs.gnu.org id=B60186.16721822957420 (code B ref 60186); Tue, 27 Dec 2022 23:05:01 +0000 Original-Received: (at 60186) by debbugs.gnu.org; 27 Dec 2022 23:04:55 +0000 Original-Received: from localhost ([127.0.0.1]:56745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAJ0B-0001vb-0E for submit@debbugs.gnu.org; Tue, 27 Dec 2022 18:04:55 -0500 Original-Received: from mail-ej1-f41.google.com ([209.85.218.41]:43566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAJ09-0001vO-LT for 60186@debbugs.gnu.org; Tue, 27 Dec 2022 18:04:54 -0500 Original-Received: by mail-ej1-f41.google.com with SMTP id kw15so34800822ejc.10 for <60186@debbugs.gnu.org>; Tue, 27 Dec 2022 15:04:53 -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=VXn8ZEM2usnS82CSGZTkruIAgOMN8iIKpCWb/VcAn64=; b=VMK8TaegAI9z0YSM+WhUYyIEbQmSKNh8Ln0iG//PpQg0T0w7ofS1TsEYWXftiWSpZ5 coOzlVWlmKvdfI42xx+LETGprBtWSzWlryPAkIQy9JR8L28+Bd+y1w5caFAFlsYMVTRf z4G+xtKRIdz1fSj24wErJ9v0IMKGFmCSVosfi7VQUorGZYY7kJgRwlBNWApINXxXRqNO JruVURmh20k7KNes2KY4fTKoFxy/Gj3U7aWQA/dbs0zwm2TiG6hriL+Hq1kvf7QMYsbK UuxdQjGoNbAoDW6GI+S9SJyZyXwEwgVHelLtgFyuPL/OtCmMGwiUAEWwq4aQWnKShrDk qv/g== 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=VXn8ZEM2usnS82CSGZTkruIAgOMN8iIKpCWb/VcAn64=; b=QWXqim/elOGrWdoQxNuPuydxs4fITI3hbd95B/3ewUS2TqAfEp78FokGjRFML1FuKm 6awtzLiVERIWrs9G0e4/Nzn0lvH9loEwFHogQZJwm3bbdOiKvlJjpG7tuO1Y3sXoE9Bi OrPWYgFv1V5TYf0NWhJCKkl2OK3DHV0qB95st5W1XsSyAvMM0yg7c7IVZ+l3YmRMjlWS TmD6q9Imj0HuPgk6iKjAdfhgtWPPWMAbtzHShoc20H8HnF836+ydIqPbZP+aNCHlAEVG bzaksNBTYcsTEFadWEKSIV1Hj51O3CPmLk9hWqUFYQ4+YH/78DYth635X8AHeP6oC9mH ejYA== X-Gm-Message-State: AFqh2kqpAE0rlMiwAJhT1tWvcoWy3QQFZDeErlGtecTUF0QzRQx/4XQ0 wD7vT5DaEbF+pBAVkPSggQ8= X-Google-Smtp-Source: AMrXdXtv+fNOZzw+k4sd0G7ripeJ5+F/+7C/vXDGpB4rPnJwiCOKjMfpY5dN7umbJACcispCNToZ9Q== X-Received: by 2002:a17:907:c78e:b0:7c5:f0a3:5d71 with SMTP id tz14-20020a170907c78e00b007c5f0a35d71mr19842406ejc.0.1672182287651; Tue, 27 Dec 2022 15:04:47 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id ss1-20020a170907038100b007c11e5ac250sm6665151ejb.91.2022.12.27.15.04.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Dec 2022 15:04:47 -0800 (PST) Content-Language: en-US In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:251969 Archived-At: On 27/12/2022 18:34, Aaron Jensen wrote: >>> Simple is what it is in comparison to something more complex. >> >> Just 1 indent vs arbitrary number of indents depending on operator >> priority/ast nesting. Seems like "simpler" is appropriate. > > Right, but that was my point. The name doesn't stand on its own. It > only stands relative to some other more complex indentation scheme. If > we can find a name that stands on its own, I think that would be > better. That's true. But it seems we've rejected most of each other's suggestions by now. >>> All >>> indentations are pretty much about line continuation in one way or >>> another. >> >> Okay, how about ruby-indent-operator-continuation? >> >> Or ruby-indent-binary-op-continuation. Which would include all binary >> operators and method calls. *shrug* We could also split off the method >> call indentation to a separate option too. > > Right, maybe it makes sense to consider one of two directions: > > 1. A single option to enable this "simple" indentation mode, i.e. > ruby-indent-alignment: line/statement/start/beginning vs. sibling/end > 2. Split each different rule into its own option and name them > according to the specific circumstance the rule covers. I still don't > know what the options would be. > > That said, when you say method calls, you mean the '.' operator, yes? > I see what you're getting at with this naming and I think it's > probably cohesive enough to be one option per #2 above. Right. If we consider "." as something distinct, it could use a separate option. Or not. But it's trivial to separate. >> "Standard" is a point of view. ;-) > > Indeed... there is also https://github.com/testdouble/standard but I > think it's a bit of a land grab to call it standard and I've never > really looked at it. Concur. > I put incremental in the last list since I was trying to get at the > fact that the indentation increases by one increment at a time. IDK, there might be different connotations, e.g. it always grows (though slowly). > Is > there something about it being that vs it context-aware? > Obviously all > indentation is context aware, so I'm not sure that that's the right > direction. "More" context-aware, one could say. Or less. But that's the same as "simpler". I suppose we could call it structural..? The current behavior, that is. As in https://github.com/yairchu/awesome-structure-editors#structural-code-editor-projects. Or here's a step back: looking at how the two other user options I named previously were ruby-method-params-indent and ruby-block-indent, the latest might as well be called ruby-operator-indent, or ruby-operator-indent and ruby-method-call-indent. I wasn't too crazy about those names originally, but the approach is very extensible with styles by adding new symbols as possible values.