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 14:47:12 +0200 Message-ID: <44ccf2d5-789f-f122-34f9-25871fdf1283@yandex.ru> References: <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> <8d554fc2-7da5-cfe1-c865-023d56d222e3@yandex.ru> <95adedfa-7644-c78b-8853-fde8ec38f621@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="37159"; 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 13:55:38 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 1pAVy5-0009RY-7a for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 28 Dec 2022 13:55:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pAVrC-0000Et-FZ; Wed, 28 Dec 2022 07:48:30 -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 1pAVqs-0000E2-JV for bug-gnu-emacs@gnu.org; Wed, 28 Dec 2022 07:48:12 -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 1pAVqk-0002Z3-Jf for bug-gnu-emacs@gnu.org; Wed, 28 Dec 2022 07:48:10 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pAVqk-0001C4-2a for bug-gnu-emacs@gnu.org; Wed, 28 Dec 2022 07:48:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 28 Dec 2022 12:48:02 +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.16722316424376 (code B ref 60186); Wed, 28 Dec 2022 12:48:02 +0000 Original-Received: (at 60186) by debbugs.gnu.org; 28 Dec 2022 12:47:22 +0000 Original-Received: from localhost ([127.0.0.1]:57236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAVq6-00018W-De for submit@debbugs.gnu.org; Wed, 28 Dec 2022 07:47:22 -0500 Original-Received: from mail-wr1-f41.google.com ([209.85.221.41]:36502) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAVq3-00018H-Uo for 60186@debbugs.gnu.org; Wed, 28 Dec 2022 07:47:20 -0500 Original-Received: by mail-wr1-f41.google.com with SMTP id bs20so12758514wrb.3 for <60186@debbugs.gnu.org>; Wed, 28 Dec 2022 04:47:19 -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=aUVdLJaqSMuRi2V7n8j2tVD3x/5WUNqA6uylRtHmbxo=; b=btsTteKkkAV07p2zzYYRNMbKdYtHFizkzdFTohOHp+6KqwOvHeGjiR0O8tFvsQM05l 3FAxHqikD3+ZMfpDa6BuvIqikQ51HL8V6C2tEwaTdTQHkeJNbVkONIVmOu8bHZU/7ZhM oOtYKGsb9iV/W+kZ6cxdwH3bykBLm6a0guFtpug49lg1KU7wuf1KahqerNpkGw9NsjzB yl0KYrvgtqPSvYhHx2AJTrq4YvZIVsK5Q1Efh4P3VD5Q5b3ZB7sfr5q15dZUtxFddLTz pPvCcZa4XrL2MpwhIXoU2a76BMxK5fyL+O97/w+u6p2/XueK8399zqb4VCLlFMMW7Wty tmSA== 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=aUVdLJaqSMuRi2V7n8j2tVD3x/5WUNqA6uylRtHmbxo=; b=NyD9v8ujv8uCfAU9bzeAKa+m5RLBWkSzoptThe7gRlAFX9o/YMhKqih7ubzfHThw0E U0QhiAUUSS7Fi7UvyJ5MRttM3Sqxi/3WKmFDymzOOhXH09Tnl6X+OoQC7AfQAHyzBSni 5sab+ZdRwt2tc2afN8PXvUqV3LUpcj9j8+8rXvCy/wWqUB5W+0doCjXad7JNUxCG8MGQ ZvK/iu41byEy+GaPhzTZZrsx1F3bZJEoRSqIrVZjiFcyaY0l87B64S7BjOd5aVa+vPE9 MxVsQma4qlFTcTzQMiJunEe8jC4JgWl7P9T+vMChlxLE+jUzE6EaTAhKFz6o69oH0SXL w1HA== X-Gm-Message-State: AFqh2krN8BFLSkIX0fOXZep5XinJml3wtPT4i2ntDgDiu6X21ytkptxV WxeJHTVt3TjedOXqX1Ia0vw= X-Google-Smtp-Source: AMrXdXu3pDanMcDnkNUmaI3fWgrfdYg9yuHIx1lRhJwb+FyPEaVpdGOR/1/d/rtxsXGnQe+GX/E+1g== X-Received: by 2002:adf:db12:0:b0:242:203c:9ed4 with SMTP id s18-20020adfdb12000000b00242203c9ed4mr17883886wri.55.1672231634102; Wed, 28 Dec 2022 04:47:14 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id v7-20020adfe287000000b00241bd177f89sm15283737wri.14.2022.12.28.04.47.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Dec 2022 04:47:13 -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:251983 Archived-At: On 28/12/2022 05:47, Aaron Jensen wrote: > On Tue, Dec 27, 2022 at 8:02 PM Dmitry Gutov wrote: >> >> On 28/12/2022 02:38, Aaron Jensen wrote: >> >>>> 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. >>> >>> This may end up being the right direction. If the values are symbols >>> you can use things that are relative to one another like "simple". >>> There could be a benefit to all of these having a "simple" option. >>> What would it mean if it were nil? >>> What's the current behavior called? >> >> For the sake of uniformity, I wanted to start with simple values -- t >> and nil, and explain their meanings in the docstring. >> >> 't' would mean the current behavior, and I'd call it "structural", or >> structure-based indentation. Or based on implicit expression grouping. > > I'd typically not use t and nil on anything but a boolean and the name > would be named after what t represents, but this may be an Emacs idiom > that is OK. If so, and there's no better options (i.e., going against > that idiom is worse than not), then that works for me. I guess that particular trend started with ruby-method-params-indent, where I haven't managed to choose better names for the var, or the values. >>> It may be that if we only intend to support two indentation schemes we >>> just have default and simplified as you suggested and then we can use >>> boolean values. I don't know how Emacs-like this is, but what if there >>> were one variable like `ruby-indent-simple` that could either be `t` >>> or a list of things to indent simply? >> >> That can work too, but what is "simple"? ;-) >> >> Further, I'm not sure if we're going to get more than 2 "things" this >> way (operators and method calls). OTOH, if we have a separate var for >> operators -- ruby-operator-indent -- we could enumerate which operators >> to indent "structurally" after. Or something like that. >> >> Not sure which direction the feature requests will drive this extension >> toward, though. Maybe mostly nowhere, given the previous history. But >> Rubocop's example seems to indicate that there are many different styles >> out there. > > Yeah, hard to say, and it may eventually become less important if > ruby-ts comes about and has enough options to satisfy folks with > different ideas about indentation. ruby-ts-mode might have extra flexibility down the line, but at the start I want to have it obey the same indentation options as ruby-mode. BTW, you can check out its progress at https://github.com/pedz/ruby-ts-mode/.