From unknown Thu Aug 14 20:53:14 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#60186 <60186@debbugs.gnu.org> To: bug#60186 <60186@debbugs.gnu.org> Subject: Status: 29.0.60; ruby-mode indentation of multi-line expressions Reply-To: bug#60186 <60186@debbugs.gnu.org> Date: Fri, 15 Aug 2025 03:53:14 +0000 retitle 60186 29.0.60; ruby-mode indentation of multi-line expressions reassign 60186 emacs submitter 60186 Aaron Jensen severity 60186 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 18 21:54:26 2022 Received: (at submit) by debbugs.gnu.org; 19 Dec 2022 02:54:26 +0000 Received: from localhost ([127.0.0.1]:37359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p76IM-0004au-2S for submit@debbugs.gnu.org; Sun, 18 Dec 2022 21:54:26 -0500 Received: from lists.gnu.org ([209.51.188.17]:55078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p76IK-0004am-48 for submit@debbugs.gnu.org; Sun, 18 Dec 2022 21:54:24 -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 1p76IJ-0005yt-Rx for bug-gnu-emacs@gnu.org; Sun, 18 Dec 2022 21:54:23 -0500 Received: from mail-vs1-xe2d.google.com ([2607:f8b0:4864:20::e2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p76II-0006hx-3V for bug-gnu-emacs@gnu.org; Sun, 18 Dec 2022 21:54:23 -0500 Received: by mail-vs1-xe2d.google.com with SMTP id h26so7495234vsr.5 for ; Sun, 18 Dec 2022 18:54:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=GKr7eJ6NW2m1vAfDPBa96r5moeSoqJHm1fLBXs5G6oM=; b=RXLrPruvVSHlhdrzUq+7LwV8zg08r5MP5K+ss29uq1Ypnv1qTK0wp8v8lPTvTB+qaV OUy6BN7bA3uedEsGcSW+At9kltge2zfyHBLQ0olN/a1OHgEfXoZbw102NxBTbq52lU6V UV82/ADG94wq9Wamy9/I5g0CtdBibzljd1Bup/t7jAj12Jd+w9M3yfPGy+M9dWbaAluQ qh2vFIzAM1hIwef5xZuBNzOGBIOARnWE7gnh92ZZqh9HHy7aO9xtbzmuUrwcqF+AAaLZ uEBTCeclM9JDl/u6aWVS5A+IsUEDl6FRQu4Gb25hMcS56SCCeoGmR+J/ZrlM19JGHxAU bdvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=GKr7eJ6NW2m1vAfDPBa96r5moeSoqJHm1fLBXs5G6oM=; b=Cr23xcn0VFTUJNZTGkfTlBfNDAQE64daWUulvGSiAhjghV73MtucaPa0x1mpyWLSAN 294z7lj2yXilkiLW2bUqZ3H/v8sG3QZkenQaHg7RnmCeZYI+DNz6MP8ajJ8MctZVnbIs 3FgYvVImYd3aOwzL8FXr/mEX+YSWfyAwqWZCWHuW9Okt+rKFv7bgCIbQt0kQOtMf8dbB jvI8FMe0JvjozYvNV3yPLesx0c7ZreiJuLO8n56UxSxBd0jMgpVugs6djdb+/XfLwf5a rWcW2q+amM1vXrP/nz51krAe0/QdBA10s8OP1fMCBFNl1nxLEl83zzI2zVnUtuxzwuWO YQmQ== X-Gm-Message-State: AFqh2kpH3dEjfyV2iCUbH/jqte6G67FoV5qRY0jIam8Ql64kAY7GOkTI kWs8X7MQiYz0JitSunq/fsBfiJ2M5IkSaA== X-Google-Smtp-Source: AMrXdXspzc06/EiI7pnCrV+aubBCVyPXU0h3z/LJru64+BMiyggz/seDZD+gi/G+/MxOBYmmsBCZyA== X-Received: by 2002:a05:6102:21db:b0:3bc:e711:1844 with SMTP id r27-20020a05610221db00b003bce7111844mr1079476vsg.20.1671418460660; Sun, 18 Dec 2022 18:54:20 -0800 (PST) Received: from Aarons-Laptop.local (c-73-23-241-101.hsd1.fl.comcast.net. [73.23.241.101]) by smtp.gmail.com with ESMTPSA id l22-20020ab07196000000b00418ccf714cfsm1194948uao.10.2022.12.18.18.54.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Dec 2022 18:54:20 -0800 (PST) From: Aaron Jensen To: bug-gnu-emacs@gnu.org Subject: 29.0.60; ruby-mode indentation of multi-line expressions Date: Sun, 18 Dec 2022 21:54:18 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::e2d; envelope-from=aaronjensen@gmail.com; helo=mail-vs1-xe2d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, 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-Spam-Score: -1.3 (-) 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.3 (--) Follow-up to bug#60110 I prefer rather simplictic indentation for Ruby (and this appears to be pretty common from codebases I've seen). Essentially, the rule is: If an expression continues on another line, indent it once. Current: some_variable = some_object. some_method Desired: some_variable = some_object. some_method Current: some_variable = some_number + some_other_number * some_third_number + some_fourth_number - some_fifth_number Desired: some_variable = some_number + some_other_number * some_third_number + some_fourth_number - some_fifth_number I don't know if this last one is related or not, but it follows the same rule plus the rule about blocks. Everything about the continuation of the expression is indented once. The contents of the block are indented once more. The end should line up with the line that opened the block. Current: some_variable = some_array. map do |x| x + 1 end Desired: some_variable = some_array. map do |x| x + 1 end From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 19 21:12:49 2022 Received: (at 60186) by debbugs.gnu.org; 20 Dec 2022 02:12:49 +0000 Received: from localhost ([127.0.0.1]:41718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7S7d-0001tA-FK for submit@debbugs.gnu.org; Mon, 19 Dec 2022 21:12:49 -0500 Received: from mail-wm1-f47.google.com ([209.85.128.47]:41843) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7S7b-0001t2-M2 for 60186@debbugs.gnu.org; Mon, 19 Dec 2022 21:12:48 -0500 Received: by mail-wm1-f47.google.com with SMTP id ay2-20020a05600c1e0200b003d22e3e796dso7796831wmb.0 for <60186@debbugs.gnu.org>; Mon, 19 Dec 2022 18:12:47 -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=6YY5jMg3/my5c2hjOj9YdAIVXX/tjuWvR0kA8JyAs8A=; b=qJ08f33Atm/Zt8BCTx0tEC8JY9wdzldQzrV9UrvNKg3BTlq+yew2eN+s8K7hEBDy2N 6MKGex9sgqb6ip0eaBjKjwAOvWmMxSsbSGU9Mk5eMdsBf+4Yimvgr+0nZ7bSUvvvpxCx t3uSqI1dv6e2q9F1SjoWb8UCbSAXHp+5q71z1xMR2jy5cZi35oxtwi8exzhwD7Z6TEIm 3FHYIm4GO9f2i1sGgya36jIFfz1N+ckZUdRfvis53ltV2he3cdtVyQYybFW5NUSLokAB xYBqt/VER4gOzNsUM1hbLqjtghvZfa6nPD3LnNE7GAr7dYF6gFDO2Q5jvEror7e90gtc goNg== 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=6YY5jMg3/my5c2hjOj9YdAIVXX/tjuWvR0kA8JyAs8A=; b=4pide95447GyyAzzuzPCR0oNZPeDBZ5xzlLnVjVnDwCuHaJg46VOrT706Vak98g/0P BePuexMDxgdEwI3cI82iWJHksY7ePLu9KSQ8pk/Syt93bhLb1rgC2ll0z+ToAUEr0zVO ANzPaYF7H2qrZX+X/jhhOA68iFX15NUeHFOljo1kzu7hv7nT35PAlp55xBxO7W+iip6H 2XQmc3SiOjx1HngKtISqBbdrY9Onhy6W5Jx3wH/Ix3QcU/xV3iNqG/JK8uLoGT8Q9HrE LJqay/7h0+HK3sF73uXKPvQnzvLQp5aUSS/eP8ogXtp8IrXgTRv4vELa9CEsLwg6Oo0R //4w== X-Gm-Message-State: ANoB5pnB/5MpohjcbQBSM0xIemkYK6w0jtaDtprI/R4Xhfbbku2XZBQm pYIn4Tb86KqQmN3QSRyBLac= X-Google-Smtp-Source: AA0mqf4kqHgJSH4unXAV5XxuYw0pVtY8LXWiYLDzI/JWoCOoisVn+h60T+PtesuD97P/A+xJnGL4EQ== X-Received: by 2002:a05:600c:4fc8:b0:3cf:614e:b587 with SMTP id o8-20020a05600c4fc800b003cf614eb587mr34208380wmq.26.1671502361703; Mon, 19 Dec 2022 18:12:41 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id l6-20020a05600c4f0600b003a3442f1229sm23423190wmq.29.2022.12.19.18.12.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Dec 2022 18:12:41 -0800 (PST) Message-ID: <4e44df18-207c-c7ca-0588-7285f3008dfb@yandex.ru> Date: Tue, 20 Dec 2022 04:12:39 +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#60186: 29.0.60; ruby-mode indentation of multi-line expressions Content-Language: en-US To: Aaron Jensen , 60186@debbugs.gnu.org References: From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 60186 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: -0.8 (/) On 19/12/2022 04:54, Aaron Jensen wrote: > > Follow-up to bug#60110 Thanks! > I prefer rather simplictic indentation for Ruby (and this appears to be > pretty common from codebases I've seen). Essentially, the rule is: If an > expression continues on another line, indent it once. FWIW, this feels a little wasteful -- working to emulate the editors which don't have much of a grammar definition, so they mostly line up things to the beginning of the previous line (plus maybe the indentation offset). But I guess that can make some experience better when working in teams. > Current: > > some_variable = some_object. > some_method > > Desired: > > some_variable = some_object. > some_method > > Current: > > some_variable = some_number + some_other_number * > some_third_number + some_fourth_number - > some_fifth_number > > Desired: > > some_variable = some_number + some_other_number * > some_third_number + some_fourth_number - > some_fifth_number This was easier to change than I expected, so here's some patch attached. It's very WIP -- before moving it to release some reorganization of indentation rules is in order, to be able to put the new option in just one place, and to streamline how indentation after "." works. This won't make it into 29.1, but we can put ruby-mode in ELPA after. > I don't know if this last one is related or not, but it follows the same > rule plus the rule about blocks. Everything about the continuation of > the expression is indented once. The contents of the block are indented > once more. The end should line up with the line that opened the block. > > Current: > > some_variable = some_array. > map do |x| > x + 1 > end > > Desired: > > some_variable = some_array. > map do |x| > x + 1 > end This will take some more work too. Not in the least because the "Desired" forms looks illogical (at least in the context of SMIE): we're already "escaping" the current syntax node to line the indentation of the block to the beginning of the statement (which makes sense, at least from the ergonomics POV), so why would the line break matter? Take more complex cases. How much indentation will the block have after some heterogeneous continuations? Is this right? some_variable = 4 + some_array. reduce do |acc, x| acc + x end What if the continuations are all after the same operator? some_variable = 4 + some_var + some_array.reduce do |acc, x| acc + x end some_variable = some_var. some_method. map do |x| x + 1 end From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 19 21:18:10 2022 Received: (at 60186) by debbugs.gnu.org; 20 Dec 2022 02:18:10 +0000 Received: from localhost ([127.0.0.1]:41742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7SCl-0001wN-97 for submit@debbugs.gnu.org; Mon, 19 Dec 2022 21:18:10 -0500 Received: from mail-ed1-f50.google.com ([209.85.208.50]:40739) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7SCg-0001vy-Gs for 60186@debbugs.gnu.org; Mon, 19 Dec 2022 21:18:06 -0500 Received: by mail-ed1-f50.google.com with SMTP id e13so15570456edj.7 for <60186@debbugs.gnu.org>; Mon, 19 Dec 2022 18:18:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:references:to:from:content-language:subject:user-agent :mime-version:date:message-id:sender:from:to:cc:subject:date :message-id:reply-to; bh=+Ny4DG5nsz+q7gX65sxyOqXfvLomDgyD6jBhkP1C2Ng=; b=n9JwcFHvaJD1A8FyxRfJUhYLDy43EHbxUhxOdUvJxWotIWbkb27tPvGnVfUPlVWysC C2CndlUfgxH5QC6QQE3SBkRCYFJiz1GMlnIbR9lA+xyOAZMwqeSgo2scLd1FVceuSLmW s1X0CWwccFRIgm0PciMpmwvmVbnjh+kAMt7CYVHKoETvrJOz49rjGSvfuSE4Q68oHihH An+VU99MNL0elJ4O2DUruZkzj3GTfnKFMGp6us9LFN6Z6O2zOkKRMWfF9q57lKogYgKi 3jnIW5ZMTP/nLO4LKGu9p6MEcvZhRdJDt2NU88SscnJBxcd7SsB06xCuABaREeqF1uvB hqlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:references:to:from: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=+Ny4DG5nsz+q7gX65sxyOqXfvLomDgyD6jBhkP1C2Ng=; b=07UnVJt71khiOYUkoqkTF8kB4QTAgyDY49qRDkRFSdAp30RoTA8KmRyOE9X105ryy2 GiItYEaueouydhSaODDO+XCPc1o7ZxP4XTJpSE9pwQrIW2KUHu2fNI2mfZ/FLv5ZLsPX Cz1YQAO1b0qTxH9eg4gL23bROufv8GSEDY62ZcA+0eiOSsTd9q2ujq5mHbV0WbcemdAP 1nEzhdAmfrM0ChUMUkrafkkPtgOG59YCHxPXQOvZcZV7JIWG/Lk5MjDHAZLFVoqQtA40 nCkc8ZrwQjJ+yOJ3PT/ailRe9R3tGCaDVkoUczp+VE0ZgGgaOfBK1uTObpXEg40g5bJs d2fA== X-Gm-Message-State: AFqh2koSC2GC6rAI6TPYtRLNS6ueweorJgnei+U2hilIIdd5uWryu7dL RUlZR828tsRNTWtmr7K6FVw= X-Google-Smtp-Source: AMrXdXvCbwy3Jgu4wHRWkg7iHyat1zfxq5zDKxYTJsTPAcxMvoSHIdg2at8pTwIk3B+K8aXFVVOqpQ== X-Received: by 2002:a05:6402:1805:b0:474:47ce:ee8e with SMTP id g5-20020a056402180500b0047447ceee8emr16029059edy.30.1671502676504; Mon, 19 Dec 2022 18:17:56 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id r20-20020aa7d154000000b0047013a9cd76sm5049165edo.56.2022.12.19.18.17.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Dec 2022 18:17:55 -0800 (PST) Content-Type: multipart/mixed; boundary="------------wCTnPh0hJGqdokp0h1ec9Qt6" Message-ID: Date: Tue, 20 Dec 2022 04:17:54 +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#60186: 29.0.60; ruby-mode indentation of multi-line expressions Content-Language: en-US From: Dmitry Gutov To: Aaron Jensen , 60186@debbugs.gnu.org References: <4e44df18-207c-c7ca-0588-7285f3008dfb@yandex.ru> In-Reply-To: <4e44df18-207c-c7ca-0588-7285f3008dfb@yandex.ru> X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 60186 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: -0.7 (/) This is a multi-part message in MIME format. --------------wCTnPh0hJGqdokp0h1ec9Qt6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 20/12/2022 04:12, Dmitry Gutov wrote: > so here's some patch attached. It's very WIP Here. --------------wCTnPh0hJGqdokp0h1ec9Qt6 Content-Type: text/x-patch; charset=UTF-8; name="ruby-simplistic-indent-wip.diff" Content-Disposition: attachment; filename="ruby-simplistic-indent-wip.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVzL3J1YnktbW9kZS5lbCBiL2xpc3AvcHJvZ21v ZGVzL3J1YnktbW9kZS5lbAppbmRleCAxZjNlOWI2YWU3Yi4uZWNkODg1MjdhZWIgMTAwNjQ0 Ci0tLSBhL2xpc3AvcHJvZ21vZGVzL3J1YnktbW9kZS5lbAorKysgYi9saXNwL3Byb2dtb2Rl cy9ydWJ5LW1vZGUuZWwKQEAgLTYwOCwxMCArNjA4LDEwIEBAIHJ1Ynktc21pZS0tYmFja3dh cmQtdG9rZW4KICAgICAgICAgICAiZGVmPSIpCiAgICAgICAgICAodCB0b2spKSkpKSkpCiAK LShkZWZ1biBydWJ5LXNtaWUtLWluZGVudC10by1zdG10ICgpCisoZGVmdW4gcnVieS1zbWll LS1pbmRlbnQtdG8tc3RtdCAoJm9wdGlvbmFsIG9mZnNldCkKICAgKHNhdmUtZXhjdXJzaW9u CiAgICAgKHNtaWUtYmFja3dhcmQtc2V4cCAiOyIpCi0gICAgKGNvbnMgJ2NvbHVtbiAoc21p ZS1pbmRlbnQtdmlydHVhbCkpKSkKKyAgICAoY29ucyAnY29sdW1uICgrIChzbWllLWluZGVu dC12aXJ0dWFsKSAob3Igb2Zmc2V0IDApKSkpKQogCiAoZGVmdW4gcnVieS1zbWllLS1pbmRl bnQtdG8tc3RtdC1wIChrZXl3b3JkKQogICAob3IgKGVxIHQgcnVieS1hbGlnbi10by1zdG10 LWtleXdvcmRzKQpAQCAtNjk2LDcgKzY5Niw3IEBAIHJ1Ynktc21pZS1ydWxlcwogICAgICAg ICAgICAgICAgICAgIChub3QgKHNtaWUtcnVsZS1ib2xwKSkpKSkKICAgICAgICAgICAgKGNv bnMgJ2NvbHVtbiAoY3VycmVudC1jb2x1bW4pKSkKICAgICAgICAoc21pZS1iYWNrd2FyZC1z ZXhwICIuIikKLSAgICAgICAoY29ucyAnY29sdW1uICgrIChjdXJyZW50LWNvbHVtbikKKyAg ICAgICAoY29ucyAnY29sdW1uICgrIChzbWllLWluZGVudC12aXJ0dWFsKQogICAgICAgICAg ICAgICAgICAgICAgICAgcnVieS1pbmRlbnQtbGV2ZWwpKSkpCiAgICAgKGAoOmJlZm9yZSAu ICwob3IgImVsc2UiICJ0aGVuIiAiZWxzaWYiICJyZXNjdWUiICJlbnN1cmUiKSkKICAgICAg KHNtaWUtcnVsZS1wYXJlbnQpKQpAQCAtNzA4LDkgKzcwOCwxMCBAQCBydWJ5LXNtaWUtcnVs ZXMKICAgICAgICAgICAgICAgICAgICAgICI8PT4iICI+IiAiPCIgIj49IiAiPD0iICI9PSIg Ij09PSIgIiE9IiAiPDwiICI+PiIKICAgICAgICAgICAgICAgICAgICAgICIrPSIgIi09IiAi Kj0iICIvPSIgIiU9IiAiKio9IiAiJj0iICJ8PSIgIl49IiAifCIKICAgICAgICAgICAgICAg ICAgICAgICI8PD0iICI+Pj0iICImJj0iICJ8fD0iICJhbmQiICJvciIpKQotICAgICAoYW5k IChzbWllLXJ1bGUtcGFyZW50LXAgIjsiIG5pbCkKLSAgICAgICAgICAoc21pZS1pbmRlbnQt LWhhbmdpbmctcCkKLSAgICAgICAgICBydWJ5LWluZGVudC1sZXZlbCkpCisgICAgIChpZiAo YW5kIChzbWllLXJ1bGUtcGFyZW50LXAgIjsiIG5pbCkKKyAgICAgICAgICAgICAgKHNtaWUt aW5kZW50LS1oYW5naW5nLXApKQorICAgICAgICAgcnVieS1pbmRlbnQtbGV2ZWwKKyAgICAg ICAocnVieS1zbWllLS1pbmRlbnQtdG8tc3RtdCBydWJ5LWluZGVudC1sZXZlbCkpKQogICAg IChgKDpiZWZvcmUgLiAiPSIpCiAgICAgIChzYXZlLWV4Y3Vyc2lvbgogICAgICAgKGFuZCAo c21pZS1ydWxlLXBhcmVudC1wICIgQCAiKQpAQCAtNzI1LDYgKzcyNiw4IEBAIHJ1Ynktc21p ZS1ydWxlcwogICAgICAgICAgKGNvbnMgJ2NvbHVtbiAoY3VycmVudC1jb2x1bW4pKSkpKQog ICAgICgnKDpiZWZvcmUgLiAiaXV3dS1tb2QiKQogICAgICAoc21pZS1ydWxlLXBhcmVudCBy dWJ5LWluZGVudC1sZXZlbCkpCisgICAgKCcoOmFmdGVyIC4gXykKKyAgICAgKHJ1Ynktc21p ZS0taW5kZW50LXRvLXN0bXQgcnVieS1pbmRlbnQtbGV2ZWwpKQogICAgICkpCiAKIChkZWZ1 biBydWJ5LS1hdC1pbmRlbnRhdGlvbi1wICgmb3B0aW9uYWwgcG9pbnQpCg== --------------wCTnPh0hJGqdokp0h1ec9Qt6-- From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 19 23:48:58 2022 Received: (at 60186) by debbugs.gnu.org; 20 Dec 2022 04:48:58 +0000 Received: from localhost ([127.0.0.1]:42366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7UYk-0005qx-4N for submit@debbugs.gnu.org; Mon, 19 Dec 2022 23:48:58 -0500 Received: from mail-pj1-f45.google.com ([209.85.216.45]:45843) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7UYi-0005qr-9K for 60186@debbugs.gnu.org; Mon, 19 Dec 2022 23:48:57 -0500 Received: by mail-pj1-f45.google.com with SMTP id v13-20020a17090a6b0d00b00219c3be9830so10933333pjj.4 for <60186@debbugs.gnu.org>; Mon, 19 Dec 2022 20:48:56 -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=A19oJxjapqoa/nv9NeUz/dS8+G5CUdFOgCXWlp0vU+A=; b=lqVMAmeCeZgJTIFnh4A9dhwJZgEAxxc6Kz4Zc6VKfd/2IlS+nizoJOv7FGfbsbEjCj a9prPFPPtn4a0TuaEs29WeywNkNwVTL2u6PRT5Gn8n+1L+uApldN7PUyo9sBeDxi8vF9 lADETQLxtI77+wtomLTqTxEhVk60MDCNmkckcGmpb+yY0l+gyI0aZBNIy/VkA1473NqC +t9DetAYsySsHu1u6a/J0uTvTD8poKrF3yuwCZiiX4dgq3NTpErSU4SvuESWliyPZZNA JWPSNukeoIaY5vCFpbLckLqbSUUF+jrveS0glhDmrk42stGZiz7pomEwT4yO6O4PwSwi u/Zw== 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=A19oJxjapqoa/nv9NeUz/dS8+G5CUdFOgCXWlp0vU+A=; b=jk+Iy0MPwneDpUZdgnjVnGHyr0PSVjlsx1mwg/QHdBOEpXX3sYBDYIjjDb1XE+FAJB 3VqcQTKpanneaTVdoAJRkPrr5EvmUUJzFB03Awe1z8s7KLu0tz00mC4jRNzzCoonY2MG ZnbRcjJZz+zbV/S58ApT05kGiR9i0XdQAOgPMCkKSj5itH7iMqG4JHGMEBriulQ9hbqY B0YKNR700PneLtJvkrlCJo86Fuova2wIt6TvX3dk6emrQb018QEWQ+JTGHWCM67+v17S 2AIK7VVDOG5bPfG1bjLXy98IVssWtKeuDDB9m+qRss24KzChzd7aw3nQQb+eZT9VkT4C J8ag== X-Gm-Message-State: ANoB5pmdkXOhY/rvO9zfPPIkxx2UVbaQ6M/v5+69pNJTj6IX8rMfUkKA d2FVOOJ4GyoZGB8a6FxtWDOWVjUQ7wIPXMNMqnwqM6AQQGGZgw== X-Google-Smtp-Source: AA0mqf5u/Od3IBeMRzXW8CnOBM8DwKu6CM64/nyCfjcXM85GdbxtCjt/4m41rGsR3M9ECm3ztrxT++wpS7fyL5AM7N4= X-Received: by 2002:a17:902:7689:b0:189:b6cf:850d with SMTP id m9-20020a170902768900b00189b6cf850dmr32731280pll.30.1671511730234; Mon, 19 Dec 2022 20:48:50 -0800 (PST) MIME-Version: 1.0 References: <4e44df18-207c-c7ca-0588-7285f3008dfb@yandex.ru> In-Reply-To: <4e44df18-207c-c7ca-0588-7285f3008dfb@yandex.ru> From: Aaron Jensen Date: Mon, 19 Dec 2022 23:48:39 -0500 Message-ID: Subject: Re: bug#60186: 29.0.60; ruby-mode indentation of multi-line expressions To: Dmitry Gutov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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 19, 2022 at 9:12 PM Dmitry Gutov wrote: > > On 19/12/2022 04:54, Aaron Jensen wrote: > > > > Follow-up to bug#60110 > > Thanks! > > > I prefer rather simplictic indentation for Ruby (and this appears to be > > pretty common from codebases I've seen). Essentially, the rule is: If an > > expression continues on another line, indent it once. > > FWIW, this feels a little wasteful -- working to emulate the editors > which don't have much of a grammar definition, so they mostly line up > things to the beginning of the previous line (plus maybe the indentation > offset). > > But I guess that can make some experience better when working in teams. The implication here is that the current indentation rules are somehow objectively better. I'd argue the opposite, that they have usability issues. :) In all seriousness though, > > Current: > > > > some_variable = some_object. > > some_method > > > > Desired: > > > > some_variable = some_object. > > some_method This one isn't quite right, maybe there was an email formatting issue. I'm expecting some_method to be indented by 1 level, for me it's 2: some_variable = some_object. some_method > > > > Current: > > > > some_variable = some_number + some_other_number * > > some_third_number + some_fourth_number - > > some_fifth_number > > > > Desired: > > > > some_variable = some_number + some_other_number * > > some_third_number + some_fourth_number - > > some_fifth_number This looks good. > > This was easier to change than I expected, so here's some patch > attached. It's very WIP -- before moving it to release some > reorganization of indentation rules is in order, to be able to put the > new option in just one place, and to streamline how indentation after > "." works. > > This won't make it into 29.1, but we can put ruby-mode in ELPA after. > > > I don't know if this last one is related or not, but it follows the same > > rule plus the rule about blocks. Everything about the continuation of > > the expression is indented once. The contents of the block are indented > > once more. The end should line up with the line that opened the block. > > > > Current: > > > > some_variable = some_array. > > map do |x| > > x + 1 > > end > > > > Desired: > > > > some_variable = some_array. > > map do |x| > > x + 1 > > end > > This will take some more work too. Not in the least because the > "Desired" forms looks illogical (at least in the context of SMIE): we're > already "escaping" the current syntax node to line the indentation of > the block to the beginning of the statement (which makes sense, at least > from the ergonomics POV), so why would the line break matter? Do you mean why are these different? some_variable = some_array. map do |x| x + 1 end vs some_variable = some_array.map do |x| x + 1 end It's because the end is lined up with the line opened the block/increased indentation. In the first example, the indented map line is the beginning and on the second, it's the assignment. > > Take more complex cases. How much indentation will the block have after > some heterogeneous continuations? Is this right? > > some_variable = 4 + > some_array. > reduce do |acc, x| > acc + x > end No, there is nothing that would cause reduce to be further indented. It should be this: some_variable = 4 + some_array. reduce do |acc, x| acc + x end > What if the continuations are all after the same operator? > > some_variable = 4 + > some_var + > some_array.reduce do |acc, x| > acc + x > end > > some_variable = some_var. > some_method. > map do |x| > x + 1 > end Yes, these look right. Thanks, Aaron From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 20 00:56:25 2022 Received: (at 60186) by debbugs.gnu.org; 20 Dec 2022 05:56:25 +0000 Received: from localhost ([127.0.0.1]:42619 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7Vc1-0006dX-73 for submit@debbugs.gnu.org; Tue, 20 Dec 2022 00:56:25 -0500 Received: from mail-pj1-f49.google.com ([209.85.216.49]:45041) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7Vbv-0006dP-UN for 60186@debbugs.gnu.org; Tue, 20 Dec 2022 00:56:22 -0500 Received: by mail-pj1-f49.google.com with SMTP id 3-20020a17090a098300b00219041dcbe9so11062339pjo.3 for <60186@debbugs.gnu.org>; Mon, 19 Dec 2022 21:56:19 -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=DLl/f9ktCeC6tJwsiEpZrsLy4CCzfokBLIlikwT4Pf0=; b=EscgVpEkungGeOL9Y57YS1LOZ+XT3ChK5c4I9MwlSWWfOMKHVofMefQHPOGU08taiT o++CBNRYA0fdcl6r6uXmsR2sL0SHawjhXFDmfxNXviyb74/AhjVVxESoOsW34SGsoaAP qREA4+pjIikBt2yBcB3V/oypkayPSHRyjTtO+5kFxAt5WtbzPTKxBs29DRxvPRf/0tNx QFhKwJNixHdr5fC+6DC989Kllx/YtOUEHLxy2yp/SpzRSlw75YMFErHHoP9K+86MX1zO c99mOSPN56M9e4UrYmo47LyiHA3mx9P4JowvmM5cHYI49iZvP6s8quZY++0Zz5guHLs4 G5ww== 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=DLl/f9ktCeC6tJwsiEpZrsLy4CCzfokBLIlikwT4Pf0=; b=SQIAv8nEGAVKxiu7d2GGZoGDkd3TWVnB7/lSOvq6+BmBVYkrc4iOfdkE6FBDo7bwNt hwZRZc2IqAjWDjyPg8GvQnd+H4I1hu8IDlgMG57TGiIoVXz2MOVF/hahPomHLbb/AbQA UkwOVBCGtR17UHstP7fWM83frmPUoALtKubVQSNGni/oY6uu5wAQLpfCkDC2WftuT8k4 xoJ0+O9yOLcK1SdOoUzeApkJDl3B4l728OH+2YxUVhaBBjgAcLBdC1oP2lX94mrpDKIw 7AjhSfGcRr/lGWJt2PuC5fFpnNL0Agt5Tpn/U1/xRINs5NlDMQhNZ9i1wOVJYfu96bKo oJUw== X-Gm-Message-State: AFqh2kpYbXRTdbd/O1UL6OoWrDUg4mFy/Vqq8Fe7iwFDG63hFZVOQ0Cf WwJ0w7daafEYDzNTv8loYEqC8wgkY3v4Yje0dRI= X-Google-Smtp-Source: AMrXdXtAKywuglemkeKl1vyKXUqZoqwcrOhU9180uUjvFMvL5m5e4VOc2ArWfBPxbJ5t5gXhHKY8G1re2Jfou4LHUB4= X-Received: by 2002:a17:90a:6e4b:b0:219:4a19:f984 with SMTP id s11-20020a17090a6e4b00b002194a19f984mr1650860pjm.198.1671515774003; Mon, 19 Dec 2022 21:56:14 -0800 (PST) MIME-Version: 1.0 References: <4e44df18-207c-c7ca-0588-7285f3008dfb@yandex.ru> In-Reply-To: From: Aaron Jensen Date: Tue, 20 Dec 2022 00:56:02 -0500 Message-ID: Subject: Re: bug#60186: 29.0.60; ruby-mode indentation of multi-line expressions To: Dmitry Gutov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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 19, 2022 at 11:48 PM Aaron Jensen wrote: > > On Mon, Dec 19, 2022 at 9:12 PM Dmitry Gutov wrote: > > > > On 19/12/2022 04:54, Aaron Jensen wrote: > > > > > > Follow-up to bug#60110 > > > > Thanks! > > > > > I prefer rather simplictic indentation for Ruby (and this appears to be > > > pretty common from codebases I've seen). Essentially, the rule is: If an > > > expression continues on another line, indent it once. > > > > FWIW, this feels a little wasteful -- working to emulate the editors > > which don't have much of a grammar definition, so they mostly line up > > things to the beginning of the previous line (plus maybe the indentation > > offset). > > > > But I guess that can make some experience better when working in teams. > > The implication here is that the current indentation > rules are somehow objectively better. I'd argue the opposite, > that they have usability issues. > > :) > > In all seriousness though, Sorry, I was going to say, this style of indentation is more inline with what I see in the wild in Ruby codebases and essentially every other editor I've seen. Also, enh-ruby-mode is what I'm using as a guide here, and it has a pretty much perfect grasp of the grammar since it uses the Ruby parser. It's just a simpler indentation norm. Aaron From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 20 10:53:41 2022 Received: (at 60186) by debbugs.gnu.org; 20 Dec 2022 15:53:41 +0000 Received: from localhost ([127.0.0.1]:45657 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7ew0-00069l-Jz for submit@debbugs.gnu.org; Tue, 20 Dec 2022 10:53:41 -0500 Received: from mail-ej1-f43.google.com ([209.85.218.43]:40577) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7evz-00069d-CE for 60186@debbugs.gnu.org; Tue, 20 Dec 2022 10:53:40 -0500 Received: by mail-ej1-f43.google.com with SMTP id jo4so21289616ejb.7 for <60186@debbugs.gnu.org>; Tue, 20 Dec 2022 07:53:39 -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=+urS3IPTXThmg1SyyEcNH4mHOq1Dw1tgtEz7BIUaKZ4=; b=iaMgspF69HFX9tPZSYfN1kob7MC1p0T2BqOiEjkh8bBkmPl/V8N3gUBCRmimcqGqG5 RWpRUkOvYK+QZ+DEzJ8dN3FCo743AdBKg3AX62szJYrvVOfLs2TKvgMTb757npl25qaQ HHUlmcJusByn1qzQKjfrJSRuNRQ9phbAq9ah/iIxEXt7Mi7rzSx5FAkdRLdWROYMIgcH a+2wQ7ywI4fJPJVJjpxWnucKVnr8CvJEpFY+OMvnecRGH28GJNy4Kw7ZqoaEE9fCtP0/ v8cvAjKEFKsdsKj6COWYosM0Zs2OycMpDSBjoSCU5GLSNk9IveACLWR6AeN3aQam3uPc sdKA== 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=+urS3IPTXThmg1SyyEcNH4mHOq1Dw1tgtEz7BIUaKZ4=; b=aUgmWp9+lIGmYARCUOXjvLgaWDMeY71ARmS/t2gFzLmrNUzxZeOW4nG7ISikhyfPIf YI9M1irg5zx6WSK0VXCsdCddCPoV7rxIY145JHenzDs4aprwinN7lK3A4xta9IXEat7a /YDdMO9K7PnDsLW+ZRNjVW7nsOgzLvOROa+4LG8ci0Ov+bOReT/2m0v4BFJfM2MPUy5h OSey+i/wZZVL0j59GW/zNZ2R6WRb2SIdFsCox6auZo8CZxHUHLNIbeSIsTigg89SKsCt 5JAH9yRHNufvrfRuy6GwZLVQ1OwN2fBWzSfKBmdb65Y3fFHxgv+0HfXY4S9SX4miDSQm 4BNA== X-Gm-Message-State: ANoB5pnIzTD17n3863Y228BznR0xPHWzkCyq6MX0lo3dSQyw00XlOfig OyraJ51Vomd1mI9eIQSqUk0= X-Google-Smtp-Source: AA0mqf7Ec4HirkB+jqhEf0ndJk65TtHDxxwrxYRT1iUrfTy6iEKAFJQahjQy0rYlB+c2czDOlvV3wg== X-Received: by 2002:a17:907:9866:b0:7c1:9e6:d38e with SMTP id ko6-20020a170907986600b007c109e6d38emr39893863ejc.67.1671551613562; Tue, 20 Dec 2022 07:53:33 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id f4-20020a17090631c400b007adf2e4c6f7sm5826306ejf.195.2022.12.20.07.53.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Dec 2022 07:53:33 -0800 (PST) Message-ID: <8142f469-be53-a35e-24e4-27b64d59be99@yandex.ru> Date: Tue, 20 Dec 2022 17:53:31 +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#60186: 29.0.60; ruby-mode indentation of multi-line expressions Content-Language: en-US To: Aaron Jensen References: <4e44df18-207c-c7ca-0588-7285f3008dfb@yandex.ru> From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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: -0.8 (/) On 20/12/2022 07:56, Aaron Jensen wrote: > On Mon, Dec 19, 2022 at 11:48 PM Aaron Jensen wrote: >> On Mon, Dec 19, 2022 at 9:12 PM Dmitry Gutov wrote: >>> On 19/12/2022 04:54, Aaron Jensen wrote: >>>> Follow-up to bug#60110 >>> Thanks! >>> >>>> I prefer rather simplictic indentation for Ruby (and this appears to be >>>> pretty common from codebases I've seen). Essentially, the rule is: If an >>>> expression continues on another line, indent it once. >>> FWIW, this feels a little wasteful -- working to emulate the editors >>> which don't have much of a grammar definition, so they mostly line up >>> things to the beginning of the previous line (plus maybe the indentation >>> offset). >>> >>> But I guess that can make some experience better when working in teams. >> The implication here is that the current indentation >> rules are somehow objectively better. I'd argue the opposite, >> that they have usability issues. >> >> 😄 >> >> In all seriousness though, > Sorry, I was going to say, this style of indentation is more inline > with what I see in the wild in Ruby codebases and essentially every > other editor I've seen. Also, enh-ruby-mode is what I'm using as a > guide here, and it has a pretty much perfect grasp of the grammar > since it uses the Ruby parser. It's just a simpler indentation norm. I do believe it's "better" in the sense that can give more hints to the user WRT to the program structure -- which, unlike in Lisp, is not always obvious. For example, this: some_variable = some_number + some_other_number * some_third_number + some_fourth_number - some_fifth_number conveys the implicit grouping, based on the operator precedence. It might be less important for * vs +, but others can be more obscure. That's not to say that it must be everyone's cup of tea, or that you want it to look "lispy" every time. Ideally, there will always be a way to write the code, with default indentation config, that the result looks "mundane". E.g. some_variable = if true 2 else 3 end => some_variable = if true 2 else 3 end (this is also customizable) or some_method(foo, bar, baz) => some_method( foo, bar, baz ) And I'll be the first to admit that the current behavior still has some usability issues (though perhaps we'll disagree on the full list). One example would be the previous bug report of yours, where the existing (the current default) behavior didn't really benefit anybody much. Another -- expressions like some_method({ foo: bar, tee: qux }, zzz) where it's not 100% obvious what TRT is, but we could probably do better. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 20 11:26:47 2022 Received: (at 60186) by debbugs.gnu.org; 20 Dec 2022 16:26:47 +0000 Received: from localhost ([127.0.0.1]:45804 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7fS2-0006UE-QX for submit@debbugs.gnu.org; Tue, 20 Dec 2022 11:26:47 -0500 Received: from mail-wr1-f46.google.com ([209.85.221.46]:45971) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7fRc-0006U2-UH for 60186@debbugs.gnu.org; Tue, 20 Dec 2022 11:26:45 -0500 Received: by mail-wr1-f46.google.com with SMTP id h16so12214753wrz.12 for <60186@debbugs.gnu.org>; Tue, 20 Dec 2022 08:26:20 -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=k2esmpnmGKWCjC5gbh3aacXGEDR+4/5ZSXGQ0vnmmr8=; b=L2ymhPcme/LhKWlG0YakdmpvL0Z4A6MFFvl0CpKsUL24cAHIdp1z538LwUT/JC/JH7 Gvga3XwrDzwUAsWAmn9aXnb7irsXYZM7IFY6M0EFD9GNhUKoBGj4cwMIb8tiwEpQzmMY QrwzzOWW1OBuzuBZRXovak6SW9WK6jCF5JpmGJmuiGgH1QX1E/hl28H9xoeYYF9MlbBo cYaqFz6L7szLPQOfRWvElSzn+VR1FCRfBqOQMMJj3GUkizXM1HKpz5VOKhf9MpJ2CJQ7 PyqeXYxoJxwu2xDwy6o8HO0jkjdp1SZYjTXWVsOxKdOgkvYhaAr7VjuE4QcTkdbxIlq6 5Ssg== 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=k2esmpnmGKWCjC5gbh3aacXGEDR+4/5ZSXGQ0vnmmr8=; b=JcIu1WZqLEPgJ81vspixETQMxS3s4+QrQV5uPKk8NOptGZRr1xh3jcoYISBlNb58zk 8OKR0fha+gphzuU/WDQn/GLzEEXo22AT9U4bMFtc7erIAvkwzhOWaR1s6Y+Pz00gX/JH Erc7Wk1kVH9jgaNf+uiSGLjdHG8AbKgCObA5u/cVdwculiV0I0/3Et/vc3C3oq6PjQhD GjKdwY/DEbWWYAW98vHysDQTB24ejFVvEmqTFqmnn7piERiJiP/GfJRTJo4j9gbQP0M2 omA/9NdpOkq9eR5oFuSxF2ry1fluyXnxPVZUQIucNxoJWBFAjP18wXuj921Szo7m1XCB iDDQ== X-Gm-Message-State: ANoB5pk5yMsUFxsyDdatebKVvVEsp0/tYIpYhPYj3YzxsV0nNfv29tP7 YVsnd5TBo+szvNeshwqaz6RdSaWo/Lc= X-Google-Smtp-Source: AA0mqf5TmwKmtyU1CyZfRtghKYH8AEN8A9ymekQPyD9gBRDBTkg3MmKratXhDqgl767niRfyUqPxaA== X-Received: by 2002:a05:600c:19c7:b0:3d0:8722:a145 with SMTP id u7-20020a05600c19c700b003d08722a145mr36032405wmq.40.1671553150682; Tue, 20 Dec 2022 08:19:10 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id n35-20020a05600c502300b003cffd3c3d6csm16402948wmr.12.2022.12.20.08.19.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Dec 2022 08:19:09 -0800 (PST) Message-ID: <358bbd65-9375-04c8-f0a2-24a4383f142e@yandex.ru> Date: Tue, 20 Dec 2022 18:19:08 +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#60186: 29.0.60; ruby-mode indentation of multi-line expressions Content-Language: en-US To: Aaron Jensen References: <4e44df18-207c-c7ca-0588-7285f3008dfb@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.2 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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: -0.8 (/) On 20/12/2022 06:48, Aaron Jensen wrote: > In all seriousness though, > >>> Current: >>> >>> some_variable = some_object. >>> some_method >>> >>> Desired: >>> >>> some_variable = some_object. >>> some_method > > This one isn't quite right, maybe there was an email formatting issue. > I'm expecting some_method to be indented by 1 level, for me it's 2: > > some_variable = some_object. > some_method Yes, that's also the "needs more work" part. >>> >>> Current: >>> >>> some_variable = some_number + some_other_number * >>> some_third_number + some_fourth_number - >>> some_fifth_number >>> >>> Desired: >>> >>> some_variable = some_number + some_other_number * >>> some_third_number + some_fourth_number - >>> some_fifth_number > > This looks good. The funny thing is this case looked more difficult originally. >> This will take some more work too. Not in the least because the >> "Desired" forms looks illogical (at least in the context of SMIE): we're >> already "escaping" the current syntax node to line the indentation of >> the block to the beginning of the statement (which makes sense, at least >> from the ergonomics POV), so why would the line break matter? > > Do you mean why are these different? > > some_variable = some_array. > map do |x| > x + 1 > end > > vs > > some_variable = some_array.map do |x| > x + 1 > end > > It's because the end is lined up with the line opened the > block/increased indentation. In the first example, the indented map > line is the beginning and on the second, it's the assignment. One might ask why it's lined up to 'map' only after it's moved to the next line, but not in the first example. Anyway, the important part is to choose an unambiguous algorithm, even if it uses its own logic. >> Take more complex cases. How much indentation will the block have after >> some heterogeneous continuations? Is this right? >> >> some_variable = 4 + >> some_array. >> reduce do |acc, x| >> acc + x >> end > > No, there is nothing that would cause reduce to be further indented. > It should be this: > > some_variable = 4 + > some_array. > reduce do |acc, x| > acc + x > end Okay, so there should be two basic cases: - Indent to the beginning of the statement, - If there was a line continuation (no matter how many), indent 1 extra level? And maybe something related to parentheses, if used. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 20 12:31:40 2022 Received: (at 60186) by debbugs.gnu.org; 20 Dec 2022 17:31:40 +0000 Received: from localhost ([127.0.0.1]:46158 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7gSq-00019k-Ez for submit@debbugs.gnu.org; Tue, 20 Dec 2022 12:31:40 -0500 Received: from mail-wr1-f42.google.com ([209.85.221.42]:37637) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7gSp-00019e-8t for 60186@debbugs.gnu.org; Tue, 20 Dec 2022 12:31:39 -0500 Received: by mail-wr1-f42.google.com with SMTP id co23so12461341wrb.4 for <60186@debbugs.gnu.org>; Tue, 20 Dec 2022 09:31:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:references:cc:to:from:content-language:subject :user-agent:mime-version:date:message-id:sender:from:to:cc:subject :date:message-id:reply-to; bh=0NH3XYZH5yEdHp5OSLlVDr/FX84jIxXr1hB/nau7CX8=; b=lmpgkHObPXoVIMbxqYXmc8GlYZVBWfy5omUBK1duFxcqkf/xF64F3WvBux+U0QH4Wc QAVC50PGonJji6wT1+2d9ENKzhv2xIWCrg7EnpVZAB7DX2VHXkNwie7KMThohyrh9Kwt KiG1RjwKC54CLNtzD6951erT7ZhRNSyeZ9GGhtX1gHEiwqhgrkwpbdcBcXoC7HcDpWAT UAjFmSQZT18D4Ll1rFs/m7L6Go6zZaLpga/W9ttevB9iA4HFi4/OmR53Pi1fQVbxQwFR IGC+pJ7HznHtC80XnhOc/ndBfh04JZeiz58+nRiDgczJN4vKh6kCVYugAMOuyhAspxrZ D+0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:references:cc:to:from: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=0NH3XYZH5yEdHp5OSLlVDr/FX84jIxXr1hB/nau7CX8=; b=VKHOnkgo3dRlV24IiE1HsyXj6JuAndIijRCzjGNBC9aCHwNDJQ/Dr2N7IpaN+BOiYX ghuYYWXtywg3MBmLnjYPmlZnq2K20/1JYrOPJdj9rQsQKe05rsiWCCoX3CNbA3msz8Qb jv6PU3Zok4J/4EnPNZH3Sdh/Lhli8tvMt5FIgvwLtIbJUtAWiFxIDEmfVYNWTuudYIGy R+JH6F1SYj5bAJUOjEWamIUFPb6cWkt7/sbIHfPLHUbAd4fr/vC/XFSFxaMuk/cTszHz P+iL2MXlKRVxRrE7spphWckO9ZoCdOXOLL5TBHpaCKsV/n9DWCTRIfONxx8/WzeeVc9m 7qlQ== X-Gm-Message-State: ANoB5pnBguaz8acALn2ZRRbowOCcsrjWOyvPnSr97SkvOezEnsmBWTMB 6akzxx2RhtyHvk3CjWARRV4= X-Google-Smtp-Source: AA0mqf6jr784vx5CwhSfxzOzcBA/gu1mrufrg7AuKXNNOf+rHdxjGRyZyMC52gvLzGN0MnSlZFfZvg== X-Received: by 2002:adf:f292:0:b0:242:7279:a56b with SMTP id k18-20020adff292000000b002427279a56bmr29692029wro.56.1671557493466; Tue, 20 Dec 2022 09:31:33 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id y18-20020a5d4ad2000000b002365cd93d05sm13313012wrs.102.2022.12.20.09.31.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Dec 2022 09:31:32 -0800 (PST) Content-Type: multipart/mixed; boundary="------------JOp91UaEMV0oISngnIhm7pP3" Message-ID: Date: Tue, 20 Dec 2022 19:31:31 +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#60186: 29.0.60; ruby-mode indentation of multi-line expressions Content-Language: en-US From: Dmitry Gutov To: Aaron Jensen References: <4e44df18-207c-c7ca-0588-7285f3008dfb@yandex.ru> <358bbd65-9375-04c8-f0a2-24a4383f142e@yandex.ru> In-Reply-To: <358bbd65-9375-04c8-f0a2-24a4383f142e@yandex.ru> X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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: -0.8 (/) This is a multi-part message in MIME format. --------------JOp91UaEMV0oISngnIhm7pP3 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 20/12/2022 18:19, Dmitry Gutov wrote: > Okay, so there should be two basic cases: > > - Indent to the beginning of the statement, > - If there was a line continuation (no matter how many), indent 1 extra > level? Here's another quick attempt to make this work without rewriting the rest of the logic. Cases 1 and 2 seem to work now, but not the block example. --------------JOp91UaEMV0oISngnIhm7pP3 Content-Type: text/x-patch; charset=UTF-8; name="ruby-simplified-indent-v2.diff" Content-Disposition: attachment; filename="ruby-simplified-indent-v2.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVzL3J1YnktbW9kZS5lbCBiL2xpc3AvcHJvZ21v ZGVzL3J1YnktbW9kZS5lbAppbmRleCAxZjNlOWI2YWU3Yi4uMDJkMmUwYTJhNzUgMTAwNjQ0 Ci0tLSBhL2xpc3AvcHJvZ21vZGVzL3J1YnktbW9kZS5lbAorKysgYi9saXNwL3Byb2dtb2Rl cy9ydWJ5LW1vZGUuZWwKQEAgLTI4NSw2IC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1rZXl3b3JkcykpKQog CisoZGVmY29uc3QgcnVieS1zbWllLS1vcGVyYXRvcnMgJygiPSIgIisiICItIiAiKiIgIi8i ICImJiIgInx8IiAiJSIgIioqIiAiXiIgIiYiCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAiPD0+IiAiPiIgIjwiICI+PSIgIjw9IiAiPT0iICI9PT0iICIhPSIgIjw8IiAi Pj4iCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKz0iICItPSIgIio9IiAi Lz0iICIlPSIgIioqPSIgIiY9IiAifD0iICJePSIgInwiCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAiPDw9IiAiPj49IiAiJiY9IiAifHw9IiAiYW5kIiAib3IiKSkKKwog KGRlZnVuIHJ1Ynktc21pZS1ydWxlcyAoa2luZCB0b2tlbikKICAgKHBjYXNlIChjb25zIGtp bmQgdG9rZW4pCiAgICAgKCcoOmVsZW0gLiBiYXNpYykgcnVieS1pbmRlbnQtbGV2ZWwpCkBA IC02ODQsNiArNjk0LDE0IEBAIHJ1Ynktc21pZS1ydWxlcwogICAgICAgICAgICAoY29ucyAn Y29sdW1uIChjdXJyZW50LWNvbHVtbikpKQogICAgICAgIChzbWllLXJ1bGUtcGFyZW50IChv ciBydWJ5LW1ldGhvZC1wYXJhbXMtaW5kZW50IDApKSkpCiAgICAgKCcoOmJlZm9yZSAuICJk byIpIChydWJ5LXNtaWUtLWluZGVudC10by1zdG10KSkKKyAgICAoYCg6YWZ0ZXIgLiAsKHBy ZWQgKGxhbWJkYSAodG9rZW4pCisgICAgICAgICAgICAgICAgICAgICAgICAgKGFuZCBydWJ5 LWluZGVudC1zaW1wbGlmaWVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZXF1YWwgdG9rZW4gIi4iKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtZW1iZXIgdG9rZW4gcnVieS1zbWllLS1v cGVyYXRvcnMpKSkpKSkKKyAgICAgKGlmIChzbWllLWluZGVudC0taGFuZ2luZy1wKQorICAg ICAgICAgKHJ1Ynktc21pZS0taW5kZW50LXRvLXN0bXQgcnVieS1pbmRlbnQtbGV2ZWwpCisg ICAgICAgKHJ1Ynktc21pZS0taW5kZW50LXRvLXN0bXQpKSkKICAgICAoJyg6YmVmb3JlIC4g Ii4iKQogICAgICAoaWYgKHNtaWUtcnVsZS1zaWJsaW5nLXApCiAgICAgICAgICAod2hlbiBy dWJ5LWFsaWduLWNoYWluZWQtY2FsbHMKQEAgLTY5NSw5ICs3MTMsMTEgQEAgcnVieS1zbWll LXJ1bGVzCiAgICAgICAgICAgICAgICAgICAgKGdvdG8tY2hhciAobnRoIDEgcGFyZW50KSkK ICAgICAgICAgICAgICAgICAgICAobm90IChzbWllLXJ1bGUtYm9scCkpKSkpCiAgICAgICAg ICAgIChjb25zICdjb2x1bW4gKGN1cnJlbnQtY29sdW1uKSkpCi0gICAgICAgKHNtaWUtYmFj a3dhcmQtc2V4cCAiLiIpCi0gICAgICAgKGNvbnMgJ2NvbHVtbiAoKyAoY3VycmVudC1jb2x1 bW4pCi0gICAgICAgICAgICAgICAgICAgICAgICBydWJ5LWluZGVudC1sZXZlbCkpKSkKKyAg ICAgICAoaWYgcnVieS1pbmRlbnQtc2ltcGxpZmllZAorICAgICAgICAgICAocnVieS1zbWll LS1pbmRlbnQtdG8tc3RtdCBydWJ5LWluZGVudC1sZXZlbCkKKyAgICAgICAgIChzbWllLWJh Y2t3YXJkLXNleHAgIi4iKQorICAgICAgICAgKGNvbnMgJ2NvbHVtbiAoKyAoY3VycmVudC1j b2x1bW4pCisgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1YnktaW5kZW50LWxldmVsKSkp KSkKICAgICAoYCg6YmVmb3JlIC4gLChvciAiZWxzZSIgInRoZW4iICJlbHNpZiIgInJlc2N1 ZSIgImVuc3VyZSIpKQogICAgICAoc21pZS1ydWxlLXBhcmVudCkpCiAgICAgKGAoOmJlZm9y ZSAuICwob3IgIndoZW4iICJpbiIpKQo= --------------JOp91UaEMV0oISngnIhm7pP3-- From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 20 15:05:25 2022 Received: (at 60186) by debbugs.gnu.org; 20 Dec 2022 20:05:25 +0000 Received: from localhost ([127.0.0.1]:46911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7irc-0007fB-PO for submit@debbugs.gnu.org; Tue, 20 Dec 2022 15:05:25 -0500 Received: from mail-pj1-f42.google.com ([209.85.216.42]:54793) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7ira-0007f3-Ro for 60186@debbugs.gnu.org; Tue, 20 Dec 2022 15:05:23 -0500 Received: by mail-pj1-f42.google.com with SMTP id o12so13520038pjo.4 for <60186@debbugs.gnu.org>; Tue, 20 Dec 2022 12:05:22 -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=Cr8ytWr+l1O0zrEwkFYPNk93TVVZoOVBf8lsy/mOLXk=; b=TcYensJrrH46GxHqMJMUENlvogowdt2wQZNEmfbWXmJjJ62+4aci0c2a/VHlpwKX45 B4UxRAW5EVolxsphmhWTj/m/Rh7KM6wkUBzzW51QHN+kV2j5AhzCVAGncF+ZRxxOQb4H YCBrf4V060QCKp13CHmUlIPxujVwBadwtuMGKKMl61qdAtTt9MRs2kMxgST6GVzfiaOK F6D2DXHNitjeKqT6njwmFucefrYhsHbUTWkYlr++Cj8OMjAFhDVYjDB90lzuRuSgcmjM GPGI9iiQg6XVhmG5I9uaGC8itmRwiYmzE89I1mVg58E398zfNNBVlNG/FiPJvOj19RZh jrcA== 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=Cr8ytWr+l1O0zrEwkFYPNk93TVVZoOVBf8lsy/mOLXk=; b=zrhqvvmBfPPg8Nw7WEmpPA6L6ZxSpmE/Ror9c4DX1lz2pdc0nCyc+uJ8NH+tVG5mND cIasxTVJ3XtVYOIEPzWemyN0RqiZ7tdvrDFKI8Tq1JzH5KAzajLoZq15iXicHsi2NMSL 6/Rp/8Ix+Mtog5qROh1aQmuPqIz1le64DRIbUgnf+YWRtLBGJ83DiN5SfJClE5bvKVI7 KZg1YdS9np/zm41Azndn8Vr9G3SeB9KiQ+PBxjKFPA88YkspaENMZ1CnA2Fyv9IcHLoQ en1gjqTzMy41X2h/+BwA7Cy8orfuSbeIW+e8Te6O7zSLVYhuf18KABQ9dnBPVHnCTUic eOhw== X-Gm-Message-State: AFqh2kqhP/04PAbI4IKV11mNBoaL342foDNNu7RzzoKDu1HqvHrSJNBQ 0YPNKB1TsflaaaiR6wyOkoeJl3MEAoHc00jzm70= X-Google-Smtp-Source: AMrXdXtToq1g1+pQTwDfg04GSbL4oarhCD7MgN7qNkLsHHbh7ERNzrChtS3BSQJs2JSGp2MAQt2cUrfgOQRWsOy0iWw= X-Received: by 2002:a17:90a:5294:b0:223:f336:1519 with SMTP id w20-20020a17090a529400b00223f3361519mr223615pjh.198.1671566716779; Tue, 20 Dec 2022 12:05:16 -0800 (PST) MIME-Version: 1.0 References: <4e44df18-207c-c7ca-0588-7285f3008dfb@yandex.ru> <358bbd65-9375-04c8-f0a2-24a4383f142e@yandex.ru> In-Reply-To: <358bbd65-9375-04c8-f0a2-24a4383f142e@yandex.ru> From: Aaron Jensen Date: Tue, 20 Dec 2022 15:05:05 -0500 Message-ID: Subject: Re: bug#60186: 29.0.60; ruby-mode indentation of multi-line expressions To: Dmitry Gutov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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 Tue, Dec 20, 2022 at 11:19 AM Dmitry Gutov wrote: > > On 20/12/2022 06:48, Aaron Jensen wrote: > > > In all seriousness though, > > > >>> Current: > >>> > >>> some_variable = some_object. > >>> some_method > >>> > >>> Desired: > >>> > >>> some_variable = some_object. > >>> some_method > > > > This one isn't quite right, maybe there was an email formatting issue. > > I'm expecting some_method to be indented by 1 level, for me it's 2: > > > > some_variable = some_object. > > some_method > > Yes, that's also the "needs more work" part. > some_variable = some_number + some_other_number * > some_third_number + > some_fourth_number - > some_fifth_number Yeah, with this I'd probably be trying to give a name to some of the things (what is the name of the product there?) I don't think I've ever seen code like that in practice to be honest. > > >>> > >>> Current: > >>> > >>> some_variable = some_number + some_other_number * > >>> some_third_number + some_fourth_number - > >>> some_fifth_number > >>> > >>> Desired: > >>> > >>> some_variable = some_number + some_other_number * > >>> some_third_number + some_fourth_number - > >>> some_fifth_number > > > > This looks good. > > The funny thing is this case looked more difficult originally. > > >> This will take some more work too. Not in the least because the > >> "Desired" forms looks illogical (at least in the context of SMIE): we're > >> already "escaping" the current syntax node to line the indentation of > >> the block to the beginning of the statement (which makes sense, at least > >> from the ergonomics POV), so why would the line break matter? > > > > Do you mean why are these different? > > > > some_variable = some_array. > > map do |x| > > x + 1 > > end > > > > vs > > > > some_variable = some_array.map do |x| > > x + 1 > > end > > > > It's because the end is lined up with the line opened the > > block/increased indentation. In the first example, the indented map > > line is the beginning and on the second, it's the assignment. > > One might ask why it's lined up to 'map' only after it's moved to the > next line, but not in the first example. It's never lined up to map, I don't think that's the right way to think about it. It's lined up to indent level 1. It isn't until after the `end' that the indent level returns to 0. Line continuation (mid-expression): +1 indent level Block opening (mid-block): +1 indent level Paren opening (mid-arguments/params): +1 indent level And all the closing/endings: -1 indent level Only one indent level can be added per line, so all that matters is where the line ends. In short, there are a set of expressions that require indentation if they span multiple lines: expression-start expression-middle expression-end I haven't tried the patch yet, but I'll give it a shot. Thank you, Aaron > > Anyway, the important part is to choose an unambiguous algorithm, even > if it uses its own logic. > > >> Take more complex cases. How much indentation will the block have after > >> some heterogeneous continuations? Is this right? > >> > >> some_variable = 4 + > >> some_array. > >> reduce do |acc, x| > >> acc + x > >> end > > > > No, there is nothing that would cause reduce to be further indented. > > It should be this: > > > > some_variable = 4 + > > some_array. > > reduce do |acc, x| > > acc + x > > end > > Okay, so there should be two basic cases: > > - Indent to the beginning of the statement, > - If there was a line continuation (no matter how many), indent 1 extra > level? > > And maybe something related to parentheses, if used. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 20 20:34:43 2022 Received: (at 60186) by debbugs.gnu.org; 21 Dec 2022 01:34:43 +0000 Received: from localhost ([127.0.0.1]:48429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7o0I-0007Qa-W6 for submit@debbugs.gnu.org; Tue, 20 Dec 2022 20:34:43 -0500 Received: from mail-pl1-f174.google.com ([209.85.214.174]:36426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7o0I-0007QU-0m for 60186@debbugs.gnu.org; Tue, 20 Dec 2022 20:34:42 -0500 Received: by mail-pl1-f174.google.com with SMTP id 4so14077362plj.3 for <60186@debbugs.gnu.org>; Tue, 20 Dec 2022 17:34:41 -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=3TVxSbvzipa38lsnd5TElhlH4RF6tJ5ljfB8T25qNi4=; b=Mq/6paIgnsGdiXlK/zzZhQrcyNtHnFA/hT+vk0+a6qL6Bpxt1t5iXuoacrDr428ReN 1//BOOo9BghUC1GezEVlEnxjEFOgdtSqJTpiENc5M17e+VdJK+/u0YTxjeFUzuRuak3X CAnnZmBCX2tdz81+EBOCQuod0/KcN3415NLwq11M4cMgzAuiRjZT/XPOu4YBYq/i8WWl JnSCnIBi+Nybr1gEUwLnNBQOwL+BuehR/oGsaBabRuv9zQy3/dFsmIwoTE8dkPXNErof rlh+6HjPYgOy8Q/TSvzwnaI+0GFkLaGSewtmTewPnWjEHQTAVqXsdKD1TIoQZBJOaOEu tFrg== 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=3TVxSbvzipa38lsnd5TElhlH4RF6tJ5ljfB8T25qNi4=; b=dqOUzk/qc6boZXL3Vpr7dpHkpZ+FKx8c0aT3em586nGIoXdCzP90FKieSb7tsEjLtG Xq7RQ5hd9eHQ6G3inyFWtCL40AV13DU5Yjdx31zj37T2Bhuo0w40qAQvxaxTMbcWwrpF zZIfs2Ia/TRtnVN7V6bgbX/y2ZT9jc3XQICRGoU0bClk7EQ+tPzs+QocA+4DfyK+UGB0 q/3pAf3ZtJKYWmXFCiRwliuFaKBYncuGOT/xPatdlyIo3QSZJBkeLhw2BtHd8CtEZ5Sv fCp3qoVs6wE1P/qHcHdf9RUIPVPF0jbgpkl0HWfntsomybDcleWufiR4anAK9YX04opN h3Cw== X-Gm-Message-State: AFqh2kpBRVKolJB1Mg+zq0VNalOL5DKoa1J9EA9xxVn2ndvNE2wVxOn+ XV4v2hLuvZ9t/zGqdfrXIvMLEP3u2xGbQWc+bw4= X-Google-Smtp-Source: AMrXdXtFlp0ead2wvcCTelCmN20NR0zLRpL3nhfkiek3l/37kUWBeL14iY+CwN8U4/Zg55M940xF9E5oKCoCL0/6848= X-Received: by 2002:a17:90a:ad8a:b0:212:e24e:16b3 with SMTP id s10-20020a17090aad8a00b00212e24e16b3mr14260pjq.69.1671586475924; Tue, 20 Dec 2022 17:34:35 -0800 (PST) MIME-Version: 1.0 References: <4e44df18-207c-c7ca-0588-7285f3008dfb@yandex.ru> <358bbd65-9375-04c8-f0a2-24a4383f142e@yandex.ru> In-Reply-To: From: Aaron Jensen Date: Tue, 20 Dec 2022 20:34:24 -0500 Message-ID: Subject: Re: bug#60186: 29.0.60; ruby-mode indentation of multi-line expressions To: Dmitry Gutov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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 Tue, Dec 20, 2022 at 12:31 PM Dmitry Gutov wrote: > > On 20/12/2022 18:19, Dmitry Gutov wrote: > > Okay, so there should be two basic cases: > > > > - Indent to the beginning of the statement, > > - If there was a line continuation (no matter how many), indent 1 extra > > level? > > Here's another quick attempt to make this work without rewriting the > rest of the logic. > > Cases 1 and 2 seem to work now, but not the block example. I haven't had a chance to try this yet, but I just wanted to mention that we put the .'s on the end of multi-line expressions, but putting them at the beginning is probably more common: some_variable = some_method .map { |x| x + 1 } .uniq I just wanted to mention that in case it mattered for the work you are doing. Thanks, Aaron From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 21 17:48:50 2022 Received: (at 60186) by debbugs.gnu.org; 21 Dec 2022 22:48:51 +0000 Received: from localhost ([127.0.0.1]:54391 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p87tK-00064o-8d for submit@debbugs.gnu.org; Wed, 21 Dec 2022 17:48:50 -0500 Received: from mail-wm1-f47.google.com ([209.85.128.47]:46053) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p87tH-00064e-O8 for 60186@debbugs.gnu.org; Wed, 21 Dec 2022 17:48:48 -0500 Received: by mail-wm1-f47.google.com with SMTP id p1-20020a05600c1d8100b003d8c9b191e0so36049wms.4 for <60186@debbugs.gnu.org>; Wed, 21 Dec 2022 14:48:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=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=1b4kmyuHnDDL5Fkq+dHM6tpjYi0ITMfBMINW9oem/4M=; b=AA9CUutTXQO/tvQdQRB6vT6YCz6zDSYL26OZGzcwapW6V1yz7ciPe/z2YAhINGlS2d bDWNnmKI+yln9a7xIo/knFGv030zHFMXh206OtVaAU5D+eg00qK/ingxHFKALrrj7OBM EVeAckeSF5xd+FwMNo4tIj9iJiFhQ1IMsIyvS3mWpxGgQhoMn6dbjvFr1oBw8tDXnN/c C3bXRhPAeD707gxWiGWNm9KY+UDiotpXoau0wQGF3bs02EkWI82UadWTiAmPEySgA8a3 PNb0S+4WdbCfAmnMeCDwRRGFcV+dsaMhQ9OqmbIAGhEdQIERi/HQgV86RrXj1H1xoG+0 oAng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=1b4kmyuHnDDL5Fkq+dHM6tpjYi0ITMfBMINW9oem/4M=; b=fdZbFi27cYdErub/LFlZ0XtXTQVvH/BbfcyBWBKQmBpr6ahYxRlKKU+CBxa9jyvC/J qdeZNv4W3t1nxdSng48yGMOVAgr3NcdJ4czQYDSTIBida2m9G3GmU8XfBtzD66l0pNro Sr2vsOanH5NLecEYSED82eh9ELBMNWVXeSygZIVsWKIykkiyPMWQkRWs/1XP4Sogcwz/ VehPI+GjltvwBiVzLCuqZDqGbIndeFk9Q+UZe2vpZFig1nTwdaHfakFwR3OIWoWS5IXO HfbfcQ5XwwIVZTuRYIBCO/OjSl3j7gmira/xsT5cOalZ3alkDmZHc2EFuQUS2rT+9Wya z58Q== X-Gm-Message-State: AFqh2kqCyrl6z3lYSZxyiA5LczYpoBc/AwcRfC6eb1QbCR5tbpzCyJZA 9fxKemfM50HCJRUDAPdj4Sc= X-Google-Smtp-Source: AMrXdXvaQncvZFOv3PVYP2nUd+W/HDV1RQ4QFM21S2pjKKV5tAC+5JTGSzRLRG4Xqz7io0XznftyPg== X-Received: by 2002:a05:600c:1e16:b0:3d1:d1a9:efde with SMTP id ay22-20020a05600c1e1600b003d1d1a9efdemr5557927wmb.12.1671662920686; Wed, 21 Dec 2022 14:48:40 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id c12-20020a05600c0a4c00b003cfa3a12660sm8824849wmq.1.2022.12.21.14.48.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Dec 2022 14:48:39 -0800 (PST) Content-Type: multipart/mixed; boundary="------------Bl7q6rA8Uybewx7PYREJDLHt" Message-ID: <2b4a91e1-bad1-382f-dd64-abf171efb404@yandex.ru> Date: Thu, 22 Dec 2022 00:48:38 +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#60186: 29.0.60; ruby-mode indentation of multi-line expressions Content-Language: en-US To: Aaron Jensen References: <4e44df18-207c-c7ca-0588-7285f3008dfb@yandex.ru> <358bbd65-9375-04c8-f0a2-24a4383f142e@yandex.ru> From: Dmitry Gutov In-Reply-To: X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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: -0.8 (/) This is a multi-part message in MIME format. --------------Bl7q6rA8Uybewx7PYREJDLHt Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 20/12/2022 22:05, Aaron Jensen wrote: >> some_variable = some_number + some_other_number * >> some_third_number + >> some_fourth_number - >> some_fifth_number > > Yeah, with this I'd probably be trying to give a name to some of the > things (what is the name of the product there?) I don't think I've > ever seen code like that in practice to be honest. Sure, but if such complex structures are not used, it also doesn't matter that the ruby-mode indents them differently from the "community baseline". But it could still help when prototyping code, fiddling with the implementation (to factor pieces out into named variables later), etc. >> One might ask why it's lined up to 'map' only after it's moved to the >> next line, but not in the first example. > > It's never lined up to map, I don't think that's the right way to > think about it. It's lined up to indent level 1. It isn't until after > the `end' that the indent level returns to 0. > > Line continuation (mid-expression): +1 indent level > Block opening (mid-block): +1 indent level > Paren opening (mid-arguments/params): +1 indent level > And all the closing/endings: -1 indent level > > Only one indent level can be added per line, so all that matters is > where the line ends. In short, there are a set of expressions that > require indentation if they span multiple lines: > > expression-start > expression-middle > expression-end I think I got it. Only one indent level can be added for the duration of a statement. Unless there are nested blocks or parens/brackets/braces. > I haven't tried the patch yet, but I'll give it a shot. See this new patch instead. The code is messier than I'd like it to be, but it seems to handle all of the cases mentioned so far and more (including the dots-at-indentation style, thanks). --------------Bl7q6rA8Uybewx7PYREJDLHt Content-Type: text/x-patch; charset=UTF-8; name="ruby-simplified-indent-v3.diff" Content-Disposition: attachment; filename="ruby-simplified-indent-v3.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVzL3J1YnktbW9kZS5lbCBiL2xpc3AvcHJvZ21v ZGVzL3J1YnktbW9kZS5lbAppbmRleCAxZjNlOWI2YWU3Yi4uMTg0ZmY2YTYxZTAgMTAwNjQ0 Ci0tLSBhL2xpc3AvcHJvZ21vZGVzL3J1YnktbW9kZS5lbAorKysgYi9saXNwL3Byb2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HNhdmUtZXhjdXJzaW9uCiAgICAgKHNtaWUtYmFja3dhcmQtc2V4cCAiOyIp Ci0gICAgKGNvbnMgJ2NvbHVtbiAoc21pZS1pbmRlbnQtdmlydHVhbCkpKSkKKyAgICAoY29u cyAnY29sdW1uICgrIChzbWllLWluZGVudC12aXJ0dWFsKSAob3Igb2Zmc2V0IDApKSkpKQor CisoZGVmdW4gcnVieS1zbWllLS1pbmRlbnQtd2l0aC1jb250aW51YXRpb24gKHRva2VuKQor ICAobGV0KiAoaW5kZW50CisgICAgICAgICAoc3RtdC1iZWcgKHNhdmUtZXhjdXJzaW9uCisg ICAgICAgICAgICAgICAgICAgICAoc21pZS1iYWNrd2FyZC1zZXhwICI7IikKKyAgICAgICAg ICAgICAgICAgICAgIChzZXRxIGluZGVudCAoc21pZS1pbmRlbnQtdmlydHVhbCkpCisgICAg ICAgICAgICAgICAgICAgICAocG9pbnQpKSkKKyAgICAgICAgIChubHMgKDEtIChjb3VudC1s aW5lcyBzdG10LWJlZyAocG9pbnQpKSkpKQorICAgICh3aGVuIChhbmQgKG5vdCAoZXF1YWwg dG9rZW4gImRvIikpIChzbWllLWluZGVudC0taGFuZ2luZy1wKSkKKyAgICAgIChjbC1pbmNm IG5scykpCisgICAgKHdoZW4gKD4gbmxzIDApIChjbC1pbmNmIGluZGVudCBydWJ5LWluZGVu dC1sZXZlbCkpCisgICAgKGNvbnMgJ2NvbHVtbiBpbmRlbnQpKSkKIAogKGRlZnVuIHJ1Ynkt c21pZS0taW5kZW50LXRvLXN0bXQtcCAoa2V5d29yZCkKICAgKG9yIChlcSB0IHJ1YnktYWxp Z24tdG8tc3RtdC1rZXl3b3JkcykKQEAgLTY0Miw3ICs2NjAsOSBAQCBydWJ5LXNtaWUtcnVs ZXMKICAgICAgICAgICAgICAgKGZvcndhcmQtY29tbWVudCAtMSkKICAgICAgICAgICAgICAg KG5vdCAoZXEgKHByZWNlZGluZy1jaGFyKSA/OikpKSkKICAgICAgICA7OyBDdXJseSBibG9j ayBvcGVuZXIuCi0gICAgICAgKHJ1Ynktc21pZS0taW5kZW50LXRvLXN0bXQpKQorICAgICAg IChpZiBydWJ5LWluZGVudC1zaW1wbGlmaWVkCisgICAgICAgICAgIChydWJ5LXNtaWUtLWlu ZGVudC13aXRoLWNvbnRpbnVhdGlvbiB0b2tlbikKKyAgICAgICAgIChydWJ5LXNtaWUtLWlu ZGVudC10by1zdG10KSkpCiAgICAgICAoKHNtaWUtcnVsZS1oYW5naW5nLXApCiAgICAgICAg OzsgVHJlYXQgcHVyZWx5IHN5bnRhY3RpYyBibG9jay1jb25zdHJ1Y3RzIGFzIGJlaW5nIHBh cnQgb2YgdGhlaXIgcGFyZW50LAogICAgICAgIDs7IHdoZW4gdGhlIG9wZW5pbmcgdG9rZW4g aXMgaGFuZ2luZyBhbmQgdGhlIHBhcmVudCBpcyBub3QgYW4KQEAgLTY4Myw3ICs3MDMsNiBA QCBydWJ5LXNtaWUtcnVsZXMKICAgICAgICAgICAgKHNraXAtY2hhcnMtZm9yd2FyZCAiIFx0 IikKICAgICAgICAgICAgKGNvbnMgJ2NvbHVtbiAoY3VycmVudC1jb2x1bW4pKSkKICAgICAg ICAoc21pZS1ydWxlLXBhcmVudCAob3IgcnVieS1tZXRob2QtcGFyYW1zLWluZGVudCAwKSkp KQotICAgICgnKDpiZWZvcmUgLiAiZG8iKSAocnVieS1zbWllLS1pbmRlbnQtdG8tc3RtdCkp CiAgICAgKCcoOmJlZm9yZSAuICIuIikKICAgICAgKGlmIChzbWllLXJ1bGUtc2libGluZy1w KQogICAgICAgICAgKHdoZW4gcnVieS1hbGlnbi1jaGFpbmVkLWNhbGxzCkBAIC02OTYsOCAr NzE1LDEwIEBAIHJ1Ynktc21pZS1ydWxlcwogICAgICAgICAgICAgICAgICAgIChub3QgKHNt aWUtcnVsZS1ib2xwKSkpKSkKICAgICAgICAgICAgKGNvbnMgJ2NvbHVtbiAoY3VycmVudC1j b2x1bW4pKSkKICAgICAgICAoc21pZS1iYWNrd2FyZC1zZXhwICIuIikKLSAgICAgICAoY29u cyAnY29sdW1uICgrIChjdXJyZW50LWNvbHVtbikKLSAgICAgICAgICAgICAgICAgICAgICAg IHJ1YnktaW5kZW50LWxldmVsKSkpKQorICAgICAgIChpZiBydWJ5LWluZGVudC1zaW1wbGlm aWVkCisgICAgICAgICAgIChydWJ5LXNtaWUtLWluZGVudC10by1zdG10IHJ1YnktaW5kZW50 LWxldmVsKQorICAgICAgICAgKGNvbnMgJ2NvbHVtbiAoKyAoY3VycmVudC1jb2x1bW4pCisg ICAgICAgICAgICAgICAgICAgICAgICAgIHJ1YnktaW5kZW50LWxldmVsKSkpKSkKICAgICAo YCg6YmVmb3JlIC4gLChvciAiZWxzZSIgInRoZW4iICJlbHNpZiIgInJlc2N1ZSIgImVuc3Vy ZSIpKQogICAgICAoc21pZS1ydWxlLXBhcmVudCkpCiAgICAgKGAoOmJlZm9yZSAuICwob3Ig IndoZW4iICJpbiIpKQpAQCAtNzEwLDE0ICs3MzEsMTYgQEAgcnVieS1zbWllLXJ1bGVzCiAg ICAgICAgICAgICAgICAgICAgICAiPDw9IiAiPj49IiAiJiY9IiAifHw9IiAiYW5kIiAib3Ii KSkKICAgICAgKGFuZCAoc21pZS1ydWxlLXBhcmVudC1wICI7IiBuaWwpCiAgICAgICAgICAg KHNtaWUtaW5kZW50LS1oYW5naW5nLXApCi0gICAgICAgICAgcnVieS1pbmRlbnQtbGV2ZWwp KQorICAgICAgICAgIChpZiBydWJ5LWluZGVudC1zaW1wbGlmaWVkCisgICAgICAgICAgICAg IChydWJ5LXNtaWUtLWluZGVudC10by1zdG10IHJ1YnktaW5kZW50LWxldmVsKQorICAgICAg ICAgICAgcnVieS1pbmRlbnQtbGV2ZWwpKSkKICAgICAoYCg6YmVmb3JlIC4gIj0iKQogICAg ICAoc2F2ZS1leGN1cnNpb24KICAgICAgIChhbmQgKHNtaWUtcnVsZS1wYXJlbnQtcCAiIEAg IikKICAgICAgICAgICAgKGdvdG8tY2hhciAobnRoIDEgKHNtaWUtaW5kZW50LS1wYXJlbnQp KSkKICAgICAgICAgICAgKHNtaWUtcnVsZS1wcmV2LXAgImRlZj0iKQogICAgICAgICAgICAo Y29ucyAnY29sdW1uICgrIChjdXJyZW50LWNvbHVtbikgcnVieS1pbmRlbnQtbGV2ZWwgLTMp KSkpKQotICAgIChgKDphZnRlciAuICwob3IgIj8iICI6IikpIHJ1YnktaW5kZW50LWxldmVs KQorICAgIChgKDphZnRlciAuICwob3IgIj8iICI6IikpICh1bmxlc3MgcnVieS1pbmRlbnQt c2ltcGxpZmllZCBydWJ5LWluZGVudC1sZXZlbCkpCiAgICAgKGAoOmJlZm9yZSAuICwoZ3Vh cmQgKG1lbXEgKGludGVybi1zb2Z0IHRva2VuKSBydWJ5LWFsaWduYWJsZS1rZXl3b3Jkcykp KQogICAgICAod2hlbiAobm90IChydWJ5LS1hdC1pbmRlbnRhdGlvbi1wKSkKICAgICAgICAo aWYgKHJ1Ynktc21pZS0taW5kZW50LXRvLXN0bXQtcCB0b2tlbikKQEAgLTcyNSw3ICs3NDgs MTggQEAgcnVieS1zbWllLXJ1bGVzCiAgICAgICAgICAoY29ucyAnY29sdW1uIChjdXJyZW50 LWNvbHVtbikpKSkpCiAgICAgKCcoOmJlZm9yZSAuICJpdXd1LW1vZCIpCiAgICAgIChzbWll LXJ1bGUtcGFyZW50IHJ1YnktaW5kZW50LWxldmVsKSkKLSAgICApKQorICAgIChgKDpiZWZv cmUgLiAsXykKKyAgICAgKHdoZW4gKGFuZCBydWJ5LWluZGVudC1zaW1wbGlmaWVkCisgICAg ICAgICAgICAgICAgKG5vdCAob3IgKG1lbWJlciB0b2tlbiAnKCIsIikpCisgICAgICAgICAg ICAgICAgICAgICAgICAgKHNtaWUtcnVsZS1wcmV2LXAgIjsiKSkpKQorICAgICAgIChsZXQq ICgoc3RtdC1iZWcgKHNhdmUtZXhjdXJzaW9uCisgICAgICAgICAgICAgICAgICAgICAgICAg IChzbWllLWJhY2t3YXJkL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g IH0KIAogICBtZW1iZXIuY2FsbCgqKmFyZ3MpCiBlbmQKQEAgLTUxMCw3ICs1MTksNyBAQCBk ZWYgcmVzb2x2ZSgqKmFyZ3MpCiAjIEVuZGxlc3MgbWV0aG9kcy4KIGNsYXNzIEJhcgogICBk ZWYgZm9vKGFiYykgPSBiYXIgKwotICAgICAgICAgICAgICAgICBiYXoKKyAgICBiYXoKIAog ICBkZWYgc2VsZi5iYXIgPQogICAgIDEyMyArCkBAIC01NDEsNCArNTUwLDUgQEAgZGVmIGJh ei5mdWxsX25hbWUgPSAiI3tiYXJ9IDMiCiAKICMgTG9jYWwgVmFyaWFibGVzOgogIyBydWJ5 LW1ldGhvZC1wYXJhbXMtaW5kZW50OiB0CisjIHJ1YnktaW5kZW50LXNpbXBsaWZpZWQ6IHQK ICMgRW5kOgo= --------------Bl7q6rA8Uybewx7PYREJDLHt-- From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 21 21:31:34 2022 Received: (at 60186) by debbugs.gnu.org; 22 Dec 2022 02:31:34 +0000 Received: from localhost ([127.0.0.1]:55359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8BMr-0008IO-QU for submit@debbugs.gnu.org; Wed, 21 Dec 2022 21:31:34 -0500 Received: from mail-pg1-f179.google.com ([209.85.215.179]:37635) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8BMp-0008IH-RN for 60186@debbugs.gnu.org; Wed, 21 Dec 2022 21:31:32 -0500 Received: by mail-pg1-f179.google.com with SMTP id v3so456182pgh.4 for <60186@debbugs.gnu.org>; Wed, 21 Dec 2022 18:31:31 -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=SqNfvnRBWXfSJ8c8EtN3XvJBRaQ3B19XBX8Emm0yRng=; b=gCnX5gXqlrv7gxAeSNEP3P6Ek/5xCouG2m2y7F/IgEeIrJ+sx8pjie1xOAbAd/UJAs Nbh6d2kSgMGAfBTwuhM2dooytJMN1EJnBN6ZZCyVLmkgjj2sYNpDogj9SX/QpJ3V+zRK 7lKje7/njbCeoKAPLRqMkB4DrAmhDnLSPVWYyWCmqBYS++eYuxMjFS+TzhgBGHCCVTjQ jHt5lijzyIFhnua10vLUd9JlC3jaSX+dUTnjluiRpOnftRdwKzfOAGMAMMt0OIJeM88T LZap9RaCjnmeWmTlK37iXuZwHenbZuoNca1HQdiBnQGDDGbtipPxDC5+GYbJX3Sx/Hmz /llA== 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=SqNfvnRBWXfSJ8c8EtN3XvJBRaQ3B19XBX8Emm0yRng=; b=wVuDvNSXUPQzADLeSydBq8twqcMwmu5getkw4Qh1zNu1U2IAkLVoQXuXcIduWjWwnG DITLIE7N/BB0o453GDVpTSXxJhX56ICCA+XyHfWouqlsAZ5QF0aU/+0ukQacNHKPYC0f 2jgc4Qrs1gKI+ra3rTUosGC4ilGOcYCvQRDP8zBFoldZ9EdO1A+ip2cE159kWxtEfwys msi4r4+FEplFEwvH6/ljwXqCyfYe8P0w0ygbiCSUSNbhU9o+dTduo1iw/U4eVdhLtVS6 tmKcCK3BH3z7ph5Fmst6anib9Bd8BX02eEYPp/Nj5J/ieoXdV3v4IJPIkpsSiWFgXeGM WL9Q== X-Gm-Message-State: AFqh2krVjurcmzNKH/sn0k/n2qnWpoUMTPevBvlttxitFJygWpTeE9ER Us4ZJ0rHd4DEs0KoBdZsfQrZrD2gU3BHRxs5q0g= X-Google-Smtp-Source: AMrXdXsBJcCC0jz/fcFBzh5OFFMFGsFdTM/+xF6L8KIQYhzCBPbb594coEbiBciHrUolyr/bhjde3oIn1gyGCI65jyQ= X-Received: by 2002:a05:6a00:1898:b0:57a:a199:9027 with SMTP id x24-20020a056a00189800b0057aa1999027mr267688pfh.13.1671676285947; Wed, 21 Dec 2022 18:31:25 -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> In-Reply-To: <2b4a91e1-bad1-382f-dd64-abf171efb404@yandex.ru> From: Aaron Jensen Date: Wed, 21 Dec 2022 21:31:14 -0500 Message-ID: Subject: Re: bug#60186: 29.0.60; ruby-mode indentation of multi-line expressions To: Dmitry Gutov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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 Wed, Dec 21, 2022 at 5:48 PM Dmitry Gutov wrote: > See this new patch instead. > > The code is messier than I'd like it to be, but it seems to handle all > of the cases mentioned so far and more (including the > dots-at-indentation style, thanks). Looks good, for the things I mentioned. I found one more case: x.foo do foo end.bar do bar end Should be: x.foo do foo end.bar do bar end I can't vouch for writing in this style, but it should only get one indentation increase in this instance, rather than, I believe. Interestingly enough, I found a bug with enh-ruby-mode that ruby-mode now indents correctly: x = bar( y ).map do |i| i end Thanks, Aaron From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 22 16:21:29 2022 Received: (at 60186) by debbugs.gnu.org; 22 Dec 2022 21:21:29 +0000 Received: from localhost ([127.0.0.1]:36324 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8T0K-0005xR-7X for submit@debbugs.gnu.org; Thu, 22 Dec 2022 16:21:28 -0500 Received: from mail-wm1-f47.google.com ([209.85.128.47]:44015) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8T0F-0005xH-U4 for 60186@debbugs.gnu.org; Thu, 22 Dec 2022 16:21:27 -0500 Received: by mail-wm1-f47.google.com with SMTP id k22-20020a05600c1c9600b003d1ee3a6289so2236022wms.2 for <60186@debbugs.gnu.org>; Thu, 22 Dec 2022 13:21:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=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=MPeytowz2hJIt4NQZXTrY+6DfQ+cAZ2YbGdPZCEcQ7w=; b=XV1hg4f95s6lBxCfrlUZSOZ3VmWaBNRgfEnP95FOhIz454PPdIBWnbC4cmUpp+4W5k 9NNgTmX8ioTSqtMwpLlHZqjIslnTIbGuXTooxjda4DmdWdR1l5viTxFxWfmBFZu9xkjF uvcoAAUaJyEki99aXKl3cdKNa+jG1pNzN+/dxbGXkVNfS6r0hkSA2q5D6GK2143g+JAY oryZJtLhyLfCCmH9M9rA3P2iYBRSQwWb0SfX3hYW1kfSOVOmohKEjJ5KjOakLiXsZK5t i2sIu79C6diPFDhJVUd7QmFayTT6lCeCrdAlJt1rsXw1Xanwc2w1YAsuQwJcVlZAVicg lJbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=MPeytowz2hJIt4NQZXTrY+6DfQ+cAZ2YbGdPZCEcQ7w=; b=MXtkIIcpYkwtYvXgCEVybGayS0tKJPF5JlNxyF/Q9ilquLedJPcR8yJlqsotdCugWK FZkxRn/N1YbZwWlqshfLEjoJql9n6021dzyD1RG6K/VntImhWXrWb75VEjE3er/rnYOD 0+E0Pqu6Pmf6FaMxL89MN/HGCxgYjbVYIMl1FnaNLyf6qTUly1Fbw5dE3oud44MozTCN cQZkEuhK/vt0Nh6889QC3pukmGS+vpExuTB1F3ILc1S4ZH4hqZuTX/6qaF8c1YXJ3YJ8 ghQljaSJcbNe1k0GFmaHcT9e3KLVaa0dcDEOB0wtwai094aJKaAz1b+DHPMIKtdTXZ53 SS0w== X-Gm-Message-State: AFqh2kp9rcJzuE9FxnqyyVTRslEnX3eAxVxynOG63y5nViY6ckWApGQM 14SOrPmfd6EmWNVN6QS1wks= X-Google-Smtp-Source: AMrXdXv4dd7DEojSzap/S1CIjAFSSyTWSW95k0+rDs6pS510CUbpmNbYRgK6CbmSJLorRH1BAlKbDQ== X-Received: by 2002:a05:600c:1d8e:b0:3d6:e23:76a2 with SMTP id p14-20020a05600c1d8e00b003d60e2376a2mr5205208wms.34.1671744077968; Thu, 22 Dec 2022 13:21:17 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id r9-20020a05600c35c900b003d96bdddd3dsm1375496wmq.15.2022.12.22.13.21.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Dec 2022 13:21:17 -0800 (PST) Content-Type: multipart/mixed; boundary="------------iahvROq0xSQd6gVEaEvMk7eT" Message-ID: <60e207e0-7378-ad9f-3ef0-99df1c139939@yandex.ru> Date: Thu, 22 Dec 2022 23:21:15 +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#60186: 29.0.60; ruby-mode indentation of multi-line expressions 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> From: Dmitry Gutov In-Reply-To: X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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 (-) This is a multi-part message in MIME format. --------------iahvROq0xSQd6gVEaEvMk7eT Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 22/12/2022 04:31, Aaron Jensen wrote: > On Wed, Dec 21, 2022 at 5:48 PM Dmitry Gutov wrote: >> See this new patch instead. >> >> The code is messier than I'd like it to be, but it seems to handle all >> of the cases mentioned so far and more (including the >> dots-at-indentation style, thanks). > > Looks good, for the things I mentioned. I found one more case: > > x.foo do > foo > end.bar do > bar > end > > Should be: > > x.foo do > foo > end.bar do > bar > end Hm, this one breaks the approach I used with the last patch (which was to count lines from the beginning of the statement). Let's see if blocks can just be aligned to the indentation of its opener's line. > I can't vouch for writing in this style, but it should only get one > indentation increase in this instance, rather than, I believe. > > Interestingly enough, I found a bug with enh-ruby-mode that ruby-mode > now indents correctly: > > x = > bar( > y > ).map do |i| > i > end Cool. It seems I broke it for the default indent algo, however. ;-( In the previous patch. See the new one attached. BTW, I'm surprised you haven't mentioned the case of parenless calls: foo bar, baz, tee IUUC the Rails core has decided to forgo this indentation style. Not sure about the statistics across other popular projects. --------------iahvROq0xSQd6gVEaEvMk7eT Content-Type: text/x-patch; charset=UTF-8; name="ruby-simplified-indent-v4.diff" Content-Disposition: attachment; filename="ruby-simplified-indent-v4.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVzL3J1YnktbW9kZS5lbCBiL2xpc3AvcHJvZ21v ZGVzL3J1YnktbW9kZS5lbAppbmRleCAxZjNlOWI2YWU3Yi4uNTQyYzhhYzAyZjEgMTAwNjQ0 Ci0tLSBhL2xpc3AvcHJvZ21vZGVzL3J1YnktbW9kZS5lbAorKysgYi9saXNwL3Byb2dtb2Rl cy9ydWJ5LW1vZGUuZWwKQEAgLTI4NSw2ICsyODUsMTEgQEAgcnVieS1tZXRob2QtcGFyYW1z LWluZGVudAogICA6c2FmZSAobGFtYmRhICh2YWwpIChvciAobWVtcSB2YWwgJyh0IG5pbCkp IChudW1iZXJwIHZhbCkpKQogICA6dmVyc2lvbiAiMjkuMSIpCiAKKyhkZWZjdXN0b20gcnVi eS1pbmRlbnQtc2ltcGxpZmllZCBuaWwKKyAgIkZvbyBiYXIuIgorICA6dHlwZSAnYm9vbGVh bgorICA6c2FmZSAnYm9vbGVhbnApCisKIChkZWZjdXN0b20gcnVieS1kZWVwLWFyZ2xpc3Qg dAogICAiRGVlcCBpbmRlbnQgbGlzdHMgaW4gcGFyZW50aGVzaXMgd2hlbiBub24tbmlsLgog QWxzbyBpZ25vcmVzIHNwYWNlcyBhZnRlciBwYXJlbnRoZXNpcyB3aGVuIGBzcGFjZScuCkBA IC00MTYsNiArNDIxLDcgQEAgcnVieS1zbWllLWdyYW1tYXIKICAgICAgJygocmlnaHQgIj0i KQogICAgICAgIChyaWdodCAiKz0iICItPSIgIio9IiAiLz0iICIlPSIgIioqPSIgIiY9IiAi fD0iICJePSIKICAgICAgICAgICAgICAgIjw8PSIgIj4+PSIgIiYmPSIgInx8PSIpCisgICAg ICAgKHJpZ2h0ICI/IikKICAgICAgICAobm9uYXNzb2MgIi4uIiAiLi4uIikKICAgICAgICAo bGVmdCAiJiYiICJ8fCIpCiAgICAgICAgKG5vbmFzc29jICI8PT4iKQpAQCAtNjA4LDEwICs2 MTQsMTAgQEAgcnVieS1zbWllLS1iYWNrd2FyZC10b2tlbgogICAgICAgICAgICJkZWY9IikK ICAgICAgICAgICh0IHRvaykpKSkpKSkKIAotKGRlZnVuIHJ1Ynktc21pZS0taW5kZW50LXRv LXN0bXQgKCkKKyhkZWZ1biBydWJ5LXNtaWUtLWluZGVudC10by1zdG10ICgmb3B0aW9uYWwg b2Zmc2V0KQogICAoc2F2ZS1leGN1cnNpb24KICAgICAoc21pZS1iYWNrd2FyZC1zZXhwICI7 IikKLSAgICAoY29ucyAnY29sdW1uIChzbWllLWluZGVudC12aXJ0dWFsKSkpKQorICAgIChj b25zICdjb2x1bW4gKCsgKHNtaWUtaW5kZW50LXZpcnR1YWwpIChvciBvZmZzZXQgMCkpKSkp CiAKIChkZWZ1biBydWJ5LXNtaWUtLWluZGVudC10by1zdG10LXAgKGtleXdvcmQpCiAgIChv ciAoZXEgdCBydWJ5LWFsaWduLXRvLXN0bXQta2V5d29yZHMpCkBAIC02NDIsNyArNjQ4LDkg QEAgcnVieS1zbWllLXJ1bGVzCiAgICAgICAgICAgICAgIChmb3J3YXJkLWNvbW1lbnQgLTEp CiAgICAgICAgICAgICAgIChub3QgKGVxIChwcmVjZWRpbmctY2hhcikgPzopKSkpCiAgICAg ICAgOzsgQ3VybHkgYmxvY2sgb3BlbmVyLgotICAgICAgIChydWJ5LXNtaWUtLWluZGVudC10 by1zdG10KSkKKyAgICAgICAoaWYgcnVieS1pbmRlbnQtc2ltcGxpZmllZAorICAgICAgICAg ICAoY29ucyAnY29sdW1uIChjdXJyZW50LWluZGVudGF0aW9uKSkKKyAgICAgICAgIChydWJ5 LXNtaWUtLWluZGVudC10by1zdG10KSkpCiAgICAgICAoKHNtaWUtcnVsZS1oYW5naW5nLXAp CiAgICAgICAgOzsgVHJlYXQgcHVyZWx5IHN5bnRhY3RpYyBibG9jay1jb25zdHJ1Y3RzIGFz IGJlaW5nIHBhcnQgb2YgdGhlaXIgcGFyZW50LAogICAgICAgIDs7IHdoZW4gdGhlIG9wZW5p bmcgdG9rZW4gaXMgaGFuZ2luZyBhbmQgdGhlIHBhcmVudCBpcyBub3QgYW4KQEAgLTY4Myw3 ICs2OTEsMTAgQEAgcnVieS1zbWllLXJ1bGVzCiAgICAgICAgICAgIChza2lwLWNoYXJzLWZv cndhcmQgIiBcdCIpCiAgICAgICAgICAgIChjb25zICdjb2x1bW4gKGN1cnJlbnQtY29sdW1u KSkpCiAgICAgICAgKHNtaWUtcnVsZS1wYXJlbnQgKG9yIHJ1YnktbWV0aG9kLXBhcmFtcy1p bmRlbnQgMCkpKSkKLSAgICAoJyg6YmVmb3JlIC4gImRvIikgKHJ1Ynktc21pZS0taW5kZW50 LXRvLXN0bXQpKQorICAgICgnKDpiZWZvcmUgLiAiZG8iKQorICAgICAoaWYgcnVieS1pbmRl bnQtc2ltcGxpZmllZAorICAgICAgICAgKGNvbnMgJ2NvbHVtbiAoY3VycmVudC1pbmRlbnRh dGlvbikpCisgICAgICAgKHJ1Ynktc21pZS0taW5kZW50LXRvLXN0bXQpKSkKICAgICAoJyg6 YmVmb3JlIC4gIi4iKQogICAgICAoaWYgKHNtaWUtcnVsZS1zaWJsaW5nLXApCiAgICAgICAg ICAod2hlbiBydWJ5LWFsaWduLWNoYWluZWQtY2FsbHMKQEAgLTY5Niw4ICs3MDcsMTAgQEAg cnVieS1zbWllLXJ1bGVzCiAgICAgICAgICAgICAgICAgICAgKG5vdCAoc21pZS1ydWxlLWJv bHApKSkpKQogICAgICAgICAgICAoY29ucyAnY29sdW1uIChjdXJyZW50LWNvbHVtbikpKQog ICAgICAgIChzbWllLWJhY2t3YXJkLXNleHAgIi4iKQotICAgICAgIChjb25zICdjb2x1bW4g KCsgKGN1cnJlbnQtY29sdW1uKQotICAgICAgICAgICAgICAgICAgICAgICAgcnVieS1pbmRl bnQtbGV2ZWwpKSkpCisgICAgICAgKGlmIHJ1YnktaW5kZW50LXNpbXBsaWZpZWQKKyAgICAg ICAgICAgKHJ1Ynktc21pZS0taW5kZW50LXRvLXN0bXQgcnVieS1pbmRlbnQtbGV2ZWwpCisg ICAgICAgICAoY29ucyAnY29sdW1uICgrIChjdXJyZW50LWNvbHVtbikKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgcnVieS1pbmRlbnQtbGV2ZWwpKSkpKQogICAgIChgKDpiZWZvcmUg LiAsKG9yICJlbHNlIiAidGhlbiIgImVsc2lmIiAicmVzY3VlIiAiZW5zdXJlIikpCiAgICAg IChzbWllLXJ1bGUtcGFyZW50KSkKICAgICAoYCg6YmVmb3JlIC4gLChvciAid2hlbiIgImlu IikpCkBAIC03MTAsMTQgKzcyMywxNiBAQCBydWJ5LXNtaWUtcnVsZXMKICAgICAgICAgICAg ICAgICAgICAgICI8PD0iICI+Pj0iICImJj0iICJ8fD0iICJhbmQiICJvciIpKQogICAgICAo YW5kIChzbWllLXJ1bGUtcGFyZW50LXAgIjsiIG5pbCkKICAgICAgICAgICAoc21pZS1pbmRl bnQtLWhhbmdpbmctcCkKLSAgICAgICAgICBydWJ5LWluZGVudC1sZXZlbCkpCisgICAgICAg ICAgKGlmIHJ1YnktaW5kZW50LXNpbXBsaWZpZWQKKyAgICAgICAgICAgICAgKHJ1Ynktc21p ZS0taW5kZW50LXRvLXN0bXQgcnVieS1pbmRlbnQtbGV2ZWwpCisgICAgICAgICAgICBydWJ5 LWluZGVudC1sZXZlbCkpKQogICAgIChgKDpiZWZvcmUgLiAiPSIpCiAgICAgIChzYXZlLWV4 Y3Vyc2lvbgogICAgICAgKGFuZCAoc21pZS1ydWxlLXBhcmVudC1wICIgQCAiKQogICAgICAg ICAgICAoZ290by1jaGFyIChudGggMSAoc21pZS1pbmRlbnQtLXBhcmVudCkpKQogICAgICAg ICAgICAoc21pZS1ydWxlLXByZXYtcCAiZGVmPSIpCiAgICAgICAgICAgIChjb25zICdjb2x1 bW4gKCsgKGN1cnJlbnQtY29sdW1uKSBydWJ5LWluZGVudC1sZXZlbCAtMykpKSkpCi0gICAg KGAoOmFmdGVyIC4gLChvciAiPyIgIjoiKSkgcnVieS1pbmRlbnQtbGV2ZWwpCisgICAgKGAo OmFmdGVyIC4gLChvciAiPyIgIjoiKSkgKHVubGVzcyBydWJ5LWluZGVudC1zaW1wbGlmaWVk IHJ1YnktaW5kZW50LWxldmVsKSkKICAgICAoYCg6YmVmb3JlIC4gLChndWFyZCAobWVtcSAo aW50ZXJuLXNvZnQgdG9rZW4pIHJ1YnktYWxpZ25hYmxlLWtleXdvcmRzKSkpCiAgICAgICh3 aGVuIChub3QgKHJ1YnktLWF0LWluZGVudGF0aW9uLXApKQogICAgICAgIChpZiAocnVieS1z bWllLS1pbmRlbnQtdG8tc3RtdC1wIHRva2VuKQpAQCAtNzI1LDcgKzc0MCwxNyBAQCBydWJ5 LXNtaWUtcnVsZXMKICAgICAgICAgIChjb25zICdjb2x1bW4gKGN1cnJlbnQtY29sdW1uKSkp KSkKICAgICAoJyg6YmVmb3JlIC4gIml1d3UtbW9kIikKICAgICAgKHNtaWUtcnVsZS1wYXJl bnQgcnVieS1pbmRlbnQtbGV2ZWwpKQotICAgICkpCisgICAgKGAoOmJlZm9yZSAuICxfKQor ICAgICAod2hlbiAoYW5kIHJ1YnktaW5kZW50LXNpbXBsaWZpZWQKKyAgICAgICAgICAgICAg ICAobm90IChvciAobWVtYmVyIHRva2VuICcoIiwiKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAoc21pZS1ydWxlLXByZXYtcCAiOyIpKSkpCisgICAgICAgKGxldCogKChzdG10LWJl ZyAoc2F2ZS1leGN1cnNpb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgKHNtaWUtYmFj a3dhcmQtc2V4cCAiOyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgIChwb2ludCkpKQor ICAgICAgICAgICAgICAobmxzICgxLSAoY291bnQtbGluZXMgc3RtdC1iZWcgKHBvaW50KSkp KSkKKyAgICAgICAgICh3aGVuIChzbWllLWluZGVudC0taGFuZ2luZy1wKQorICAgICAgICAg ICAoY2wtaW5jZiBubHMpKQorICAgICAgICAgKHJ1Ynktc21pZS0taW5kZW50LXRvLXN0bXQg KGlmICg+IG5scyAwKSBydWJ5LWluZGVudC1sZXZlbCAwKSkpKSkpKQogCiAoZGVmdW4gcnVi eS0tYXQtaW5kZW50YXRpb24tcCAoJm9wdGlvbmFsIHBvaW50KQogICAoc2F2ZS1leGN1cnN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LDEyIEBAIGRlZiBiYXIKICAgZW5kCiBlbmQKIAoreC5mb28gZG8KKyAg Zm9vCitlbmQuYmFyIGRvCisgIGJhcgorZW5kCisKIGZvbyB8CiAgIGJhcgogCkBAIC01NDEs NCArNTYwLDUgQEAgZGVmIGJhei5mdWxsX25hbWUgPSAiI3tiYXJ9IDMiCiAKICMgTG9jYWwg VmFyaWFibGVzOgogIyBydWJ5LW1ldGhvZC1wYXJhbXMtaW5kZW50OiB0CisjIHJ1YnktaW5k ZW50LXNpbXBsaWZpZWQ6IG5pbAogIyBFbmQ6CmRpZmYgLS1naXQgYS90ZXN0L2xpc3AvcHJv Z21vZGVzL3J1YnktbW9kZS10ZXN0cy5lbCBiL3Rlc3QvbGlzcC9wcm9nbW9kZXMvcnVieS1t b2RlLXRlc3RzLmVsCmluZGV4IDU2MGY3ODAyODVhLi40YTg2NDkyYjEzNyAxMDA2NDQKLS0t IGEvdGVzdC9saXNwL3Byb2dtb2Rlcy9ydWJ5LW1vZGUtdGVzdHMuZWwKKysrIGIvdGVzdC9s aXNwL3Byb2dtb2Rlcy9ydWJ5LW1vZGUtdGVzdHMuZWwKQEAgLTk1Nyw2ICs5NTcsNyBAQCBy dWJ5LWRlZnRlc3QtaW5kZW50CiAKIChydWJ5LWRlZnRlc3QtaW5kZW50ICJydWJ5LnJiIikK IChydWJ5LWRlZnRlc3QtaW5kZW50ICJydWJ5LW1ldGhvZC1wYXJhbXMtaW5kZW50LnJiIikK KyhydWJ5LWRlZnRlc3QtaW5kZW50ICJydWJ5LWluZGVudC1zaW1wbGlmaWVkLnJiIikKIAog KGVydC1kZWZ0ZXN0IHJ1YnktLXRlc3QtY2hhaW5lZC1pbmRlbnRhdGlvbiAoKQogICAod2l0 aC10ZW1wLWJ1ZmZlcgo= --------------iahvROq0xSQd6gVEaEvMk7eT-- From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 22 23:13:13 2022 Received: (at 60186) by debbugs.gnu.org; 23 Dec 2022 04:13:13 +0000 Received: from localhost ([127.0.0.1]:36550 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8ZQm-0001ux-Tc for submit@debbugs.gnu.org; Thu, 22 Dec 2022 23:13:13 -0500 Received: from mail-pf1-f177.google.com ([209.85.210.177]:39574) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8ZQl-0001uq-0N for 60186@debbugs.gnu.org; Thu, 22 Dec 2022 23:13:11 -0500 Received: by mail-pf1-f177.google.com with SMTP id w26so2558694pfj.6 for <60186@debbugs.gnu.org>; Thu, 22 Dec 2022 20:13:10 -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=cyYklORKF5GPn1j2xRMYyp/6C1v/cTZz4rFmEpkcZp8=; b=IeCq2Azgg1pF5mBGPD3WuK6qX1J8XBAZAnkERjC/7dHZoX4n/dMvZA6U9liVeWzTTq U0oAvBEoGQ66FjI9RxXfyAQIlCM6J0USCtOTlnO+HoARQxqlMy9G7D6ih+4YDrxMD5ci 2a2T4jU9mSTVyKtDuYVnfmf0Q5uZ0PwPwpM1Yh+2Jpf0eorQwRLvk6lWs5cZfgMVzvrM jqwtIA65gOho+1CmOaQcp3FJhZktx5ubJoAAR24ExQyLK9GS+3EY+BntTC3JjE0HmD1m yDBokGYQmiaEkPVeS/V2m0TFmw1BxVOnpBGgJts8cl5F3UeLIKDxF/2iqix99/QIPWea m0SQ== 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=cyYklORKF5GPn1j2xRMYyp/6C1v/cTZz4rFmEpkcZp8=; b=KhXpqsExfvxmQXYvHCXyzHvQlVrGJYxEp3P81ZCjUSs0EWHwL7DJ2mUYQ3zPrIqlqZ ihhwK30Gn3wR/kYvL0te0GmYHDlbXrGj8gzz7V83fHicMW1UgimfyFYRL5mGKshwQn1S V5nP8/H5O+UTq6hzhGH4kVwo4XyCHGhIW3TtUvmaepS0xiiEOAW9HqsMOrHQYp8f25H+ c/XgFPVvAYiBMQPikjiD84QDn8gdAOdlr+BDQAZBDs4Ot4tnbFsvefBWdiNJhM+ikAbW N78+ORwpQolX3gwfx7wFO3bNXYiohCSnAzp5DiyIOTwLI/ZqWGYLqqyX9N555nIs87MP hn8w== X-Gm-Message-State: AFqh2kok0TvgmOcDDfcnqSXX+SOTLdAJ1ZROnPOKxf/Gfv5vfC0u1klQ jzRAALcqiWgXttSJOkNw2PXnl2yM031Q+83JU2w= X-Google-Smtp-Source: AMrXdXu8u+WZZpu29nEMNvOgQTETFBx7oYZJNr3D0J2U8rE61Llk8XcFbmKr3xsrQmE91Z5fojJZgmlFtL2O/D4+qd8= X-Received: by 2002:a63:4d12:0:b0:478:a6de:4d1b with SMTP id a18-20020a634d12000000b00478a6de4d1bmr358111pgb.95.1671768784663; Thu, 22 Dec 2022 20:13:04 -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> In-Reply-To: <60e207e0-7378-ad9f-3ef0-99df1c139939@yandex.ru> From: Aaron Jensen Date: Thu, 22 Dec 2022 23:12:53 -0500 Message-ID: Subject: Re: bug#60186: 29.0.60; ruby-mode indentation of multi-line expressions To: Dmitry Gutov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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 Thu, Dec 22, 2022 at 4:21 PM Dmitry Gutov wrote: > > On 22/12/2022 04:31, Aaron Jensen wrote: > > On Wed, Dec 21, 2022 at 5:48 PM Dmitry Gutov wrote: > >> See this new patch instead. > >> > >> The code is messier than I'd like it to be, but it seems to handle all > >> of the cases mentioned so far and more (including the > >> dots-at-indentation style, thanks). > > > > Looks good, for the things I mentioned. I found one more case: > > > > x.foo do > > foo > > end.bar do > > bar > > end > > > > Should be: > > > > x.foo do > > foo > > end.bar do > > bar > > end > > Hm, this one breaks the approach I used with the last patch (which was > to count lines from the beginning of the statement). > > Let's see if blocks can just be aligned to the indentation of its > opener's line. > > > I can't vouch for writing in this style, but it should only get one > > indentation increase in this instance, rather than, I believe. > > > > Interestingly enough, I found a bug with enh-ruby-mode that ruby-mode > > now indents correctly: > > > > x = > > bar( > > y > > ).map do |i| > > i > > end > > Cool. It seems I broke it for the default indent algo, however. ;-( In > the previous patch. > > See the new one attached. Seems to work well with everything I threw at it. > BTW, I'm surprised you haven't mentioned the case of parenless calls: > > foo bar, > baz, > tee > > IUUC the Rails core has decided to forgo this indentation style. Not > sure about the statistics across other popular projects. I try to avoid this style in general. The simplified style with the 2 spaces means the first argument is on a different plane than the rest which negatively impacts scanning. With either indentation style, the first argument (which is the most significant one when a method is properly designed) will have the least presence when scanning. It's just not a good format in my experience. In our code we take it a step further and always use parentheses except for in class level "macros". This means that any time we decide to split a method invocation on multiple lines we use the basic newline after ( style. Aaron From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 23 17:26:12 2022 Received: (at 60186) by debbugs.gnu.org; 23 Dec 2022 22:26:12 +0000 Received: from localhost ([127.0.0.1]:39167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8qUW-0002ia-1S for submit@debbugs.gnu.org; Fri, 23 Dec 2022 17:26:12 -0500 Received: from mail-wm1-f42.google.com ([209.85.128.42]:52925) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8qUT-0002iT-CX for 60186@debbugs.gnu.org; Fri, 23 Dec 2022 17:26:11 -0500 Received: by mail-wm1-f42.google.com with SMTP id ay40so4407596wmb.2 for <60186@debbugs.gnu.org>; Fri, 23 Dec 2022 14:26:09 -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=v1b+zTEFRebFNpKgmobr7pPXTu/3Fbxk4mVdUuV5Jls=; b=BlegQi9PddxkHfC2mflGqtNwPfmw+h4iBu7sKdBkHwTQ1nwO7SqDH9ZdrYVLrSuOJd xosaGslG7VGq/N9Cf7omrEjTX6GjPwdKgP1SShop3pPJGFd+j8aSyHTHSIoQ47qWYzx3 WexRinAFJLbPcHEGLri8o5i5hTUV6OlDH1WyTV38rkgvgmwNiPRuwj823N66sfywpItp YziR1WEy8cHeuHQIpxVBh4GwZjlzUGWrvqEEd9fkif/RzvcD792D+OOCsXGh26P5oJya rrGsRWsWTvRIsP8RJl+KSCUvo0cimPsMdQ/g8YVb9LaLEh2RgniLIwTSgbsyjQDROyk+ LGVQ== 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=v1b+zTEFRebFNpKgmobr7pPXTu/3Fbxk4mVdUuV5Jls=; b=bOi7j1WOafqqDAHuUDKJ19ts2JV34TPCAri0xrHoLrGXoxBTMLTRyjRsDWgcmjL82f TCWBLiTWt0LcufR9lYqTkd0+GqFvWHeoX8nqpZp1FA636cb/EwDhbl1R76OAGcslh1Rk pAmqDJYzXmaNDgyWl4qVC2fj7BzrUDjPJIpe+tzAsWA8iEj7ONuqDWQxFKNa2ivGnbg5 6J4z8fSTlekSCc0zpCDx2jmGF9r2T9a+WGX4V1Rjhk9kGfK5IMNOmIChdFoswcm2TSI0 wi+0S+wDYZaDY/D3w4c0lzfy9VPwTuPIltcZVv6JVTu158RcfsnV32g2Q5gHa7UQIRzC Snag== X-Gm-Message-State: AFqh2kr5jev29zQMf1Bl60CDk09d+LfCnG6PeERxYkjYHUeyGK5UY5ld +EJAWrGYYL7d5VlA212H+e0= X-Google-Smtp-Source: AMrXdXvVB8dBCGw+iSQpdnnkYC2t0Nxrd4PJuzpt+ZjF622JYEhLdlV+ezddOG698enAiQI1u05I3g== X-Received: by 2002:a05:600c:a51:b0:3d2:3376:6f38 with SMTP id c17-20020a05600c0a5100b003d233766f38mr8153412wmq.20.1671834363289; Fri, 23 Dec 2022 14:26:03 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id be13-20020a05600c1e8d00b003d1e4f3ac8esm5855256wmb.33.2022.12.23.14.26.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Dec 2022 14:26:02 -0800 (PST) Message-ID: <902440c7-706a-20e1-55af-4e12e8cdda2c@yandex.ru> Date: Sat, 24 Dec 2022 00:26:00 +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#60186: 29.0.60; ruby-mode indentation of multi-line expressions 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> 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: 60186 Cc: 60186@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 23/12/2022 06:12, Aaron Jensen wrote: >> See the new one attached. > > Seems to work well with everything I threw at it. Thank you. I think I'll tinker with it and then push to master sometime later. Maybe after 29 RC is cut, or if I get to a nicer rewrite earlier. >> BTW, I'm surprised you haven't mentioned the case of parenless calls: >> >> foo bar, >> baz, >> tee >> >> IUUC the Rails core has decided to forgo this indentation style. Not >> sure about the statistics across other popular projects. > > I try to avoid this style in general. Is that also true for the other "codebases you've seen" referred to in the first message here? > The simplified style with the 2 > spaces means the first argument is on a different plane than the rest > which negatively impacts scanning. Makes sense. > With either indentation style, the > first argument (which is the most significant one when a method is > properly designed) will have the least presence when scanning. It's > just not a good format in my experience. In our code we take it a step > further and always use parentheses except for in class level "macros". That's also my preference and true of the code I've seen. But "class level macros" are often an important part of projects, be that ActiveRecord validations, or DSL-like calls in Grape (routes, params, etc). So I wonder whether we should alter parenless calls' indentation for the "simplified" style. I checked out some popular projects out there. Rails' style is inconsistent, with class-level parenless calls lined up vertically and the rare use of them inside methods seem to go the "simplified" route. I'm not sure if that's intentional, or whether it's just written by different people. Redmine mixes styles, but mostly on the side of lining up. Spree lines up and overall seems to vindicate the default "lispy" indentation style, e.g. here: https://github.com/spree/spree/blob/main/core/app/models/spree/zone.rb https://github.com/spree/spree/blob/main/core/app/models/spree/tax_rate.rb Though they also like to line up the keyword arguments according to Rubocop's defaults (https://github.com/spree/spree/blob/main/core/app/models/spree/product.rb#L63), something we don't support yet. Do you have a source-available example of a project in your preferred coding style? Chef, perhaps? https://github.com/chef/chef/blob/main/lib/chef/application/base.rb https://github.com/chef/chef/blob/main/lib/chef/application/client.rb > This means that any time we decide to split a method invocation on > multiple lines we use the basic newline after ( style. For "class-level macros" as well? From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 23 19:17:32 2022 Received: (at 60186) by debbugs.gnu.org; 24 Dec 2022 00:17:32 +0000 Received: from localhost ([127.0.0.1]:39641 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8sEG-0003zM-1U for submit@debbugs.gnu.org; Fri, 23 Dec 2022 19:17:32 -0500 Received: from mail-pg1-f173.google.com ([209.85.215.173]:42676) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8sED-0003zE-Rw for 60186@debbugs.gnu.org; Fri, 23 Dec 2022 19:17:30 -0500 Received: by mail-pg1-f173.google.com with SMTP id v62so1181819pgd.9 for <60186@debbugs.gnu.org>; Fri, 23 Dec 2022 16:17:29 -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=Gf2SHRfmdAGn1ef+ac6BCiBWzNfgJG2LY76u78OdtDQ=; b=D232sYX9YrDKJxgv7M2HBzWVjGgJsvwBvswZi3OWE8tzlxzfgEW/pDQ/ynfyDjJ/wz /PNcB2PA0AwIDNG2JyEaL0loNXPVAEy/4C50Uws4d339A8UXbRt8NadLpTm+w5PLCZFI 612nlTjSw5ZpxvyprqCS0Pz31tXOFs0yldTfu2UeGBS2zTD1D/SJhiqUzl3JeIwvPH3t pJPucYRy/DstUtC441+3F5oDULlAaCYIstC7cRePqn+MLDV9r5zVe9bYrZyxp4kjTFpL UZFYG5YtRATL55qe0vffoFSncLCBEK7HafyWlH837IMhUzuf8NUoKyND/kP9mkwnE921 4Z6w== 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=Gf2SHRfmdAGn1ef+ac6BCiBWzNfgJG2LY76u78OdtDQ=; b=aG9+Fr+u4oajCaiLv+hVqCL0InhYhzMIeStTt92Sd3fd7HcAUEfttGAW2D80iWV29d LcRDvGNDZxx5QGFEAdMMzSOMmzWEPDtIRQobtCKC8PTUfGQ6FReZtvdk6zWvZIdDRYYF Fp8Mxscqi+VHG9sEa6Xu5ku3N4Y3GWHbqCEz7AS/ucsfZS+RIJh7pSLUA2D1/OEcEjIi Jyshth8qBgMvCCW8oGvQNl0vVGENAvDecQMPJq6p8VmnTa/v3MmQxS2x3dpoFvlRKZ+k bSZNDjz4AVzmbNav3AyaLW4+jW/zEXDY71RNGr1LwnGICUUAn3w8PxYvKU52d6TsR4sm M0jg== X-Gm-Message-State: AFqh2kpw5mID0JIXA7XFFiFhBfKrEoNCSJcTK5fJSFvzQN7SVOTTfvI4 k3FW9jKi+aFMgLR4KBg0fCcJlp5tcH6cvScCOXA= X-Google-Smtp-Source: AMrXdXvR3RWPU5GicgvF8M1cHmVcuuV7lDfp7OYnFC/paCnDL6if+7l6oRoPY4khy9oJhj0SFDLdDPZEJ2tAO7XlnMA= X-Received: by 2002:a63:4d12:0:b0:478:a6de:4d1b with SMTP id a18-20020a634d12000000b00478a6de4d1bmr497068pgb.95.1671841042894; Fri, 23 Dec 2022 16:17:22 -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> In-Reply-To: <902440c7-706a-20e1-55af-4e12e8cdda2c@yandex.ru> From: Aaron Jensen Date: Fri, 23 Dec 2022 19:17:11 -0500 Message-ID: Subject: Re: bug#60186: 29.0.60; ruby-mode indentation of multi-line expressions To: Dmitry Gutov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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 Fri, Dec 23, 2022 at 5:26 PM Dmitry Gutov wrote: > > Is that also true for the other "codebases you've seen" referred to in > the first message here? Mostly we work with Rails (and I try to avoid looking at that code as much as I can, though I often find myself in there...) and the Eventide framework: https://github.com/eventide-project Given that the two founders of that are on my team we tend to follow their indentation and coding style (and it is well-thought out, with everything considered with respect to human cognition/eye tracking studies/etc.). That's probably the best example I could offer, though what you will find in there is that not many lines of code span more than one line. They (and we) tend to allow longer lines when the right side of the line is less important. > > With either indentation style, the > > first argument (which is the most significant one when a method is > > properly designed) will have the least presence when scanning. It's > > just not a good format in my experience. In our code we take it a step > > further and always use parentheses except for in class level "macros". > > That's also my preference and true of the code I've seen. But "class > level macros" are often an important part of projects, be that > ActiveRecord validations, or DSL-like calls in Grape (routes, params, etc). > > So I wonder whether we should alter parenless calls' indentation for the > "simplified" style. I think I would tend towards saying yes, make it simple/like the chef codebase. That's consistent and if one wants to line things up, then one can use parens, even with class level macros (or use long lines and not care). > I checked out some popular projects out there. Rails' style is > inconsistent, with class-level parenless calls lined up vertically and > the rare use of them inside methods seem to go the "simplified" route. > I'm not sure if that's intentional, or whether it's just written by > different people. > > Redmine mixes styles, but mostly on the side of lining up. > > Spree lines up and overall seems to vindicate the default "lispy" > indentation style, e.g. here: > > https://github.com/spree/spree/blob/main/core/app/models/spree/zone.rb > https://github.com/spree/spree/blob/main/core/app/models/spree/tax_rate.rb > > Though they also like to line up the keyword arguments according to > Rubocop's defaults > (https://github.com/spree/spree/blob/main/core/app/models/spree/product.rb#L63), > something we don't support yet. This line is rather painful to read and inconsistent with the call just below it on line 70. I would certainly not advocate for that. > Do you have a source-available example of a project in your preferred > coding style? > > Chef, perhaps? > > https://github.com/chef/chef/blob/main/lib/chef/application/base.rb > https://github.com/chef/chef/blob/main/lib/chef/application/client.rb Yeah, I think this is probably the closest with regard to indentation aside from Eventide, but again, you won't find much indentation there. Whatever you find will likely be Vim's default, which I believe is the same simple two space indent we are discussing. > > This means that any time we decide to split a method invocation on > > multiple lines we use the basic newline after ( style. > > For "class-level macros" as well? I found inconsistencies in our codebase, so it is time for us to establish a new norm. My guess is that we will land on using parens for it. When we do it without parens, it is in the simplified style. Thank you for your research and work on this, I appreciate it. Aaron From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 24 17:48:07 2022 Received: (at 60186) by debbugs.gnu.org; 24 Dec 2022 22:48:07 +0000 Received: from localhost ([127.0.0.1]:47282 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9DJG-0008QY-AN for submit@debbugs.gnu.org; Sat, 24 Dec 2022 17:48:07 -0500 Received: from mail-wm1-f44.google.com ([209.85.128.44]:54904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9DJD-0008PC-Me for 60186@debbugs.gnu.org; Sat, 24 Dec 2022 17:48:04 -0500 Received: by mail-wm1-f44.google.com with SMTP id o15so5728077wmr.4 for <60186@debbugs.gnu.org>; Sat, 24 Dec 2022 14:48:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=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=dkl/nBUaeMYckUhTpbzntN/k0eYYaext61DY4UGDyHA=; b=mQDgQhTdCwTXFjNMbd+H7CMGMoqOG6y8223DQxtcWjNLwb1qHa13mX9YNdUCCYj40L DqTqDHjXk9Uu2vqXONC4MMTrzzyMVcMy2xPZtPG8tNsho7YuXYdLzVP2449mMk1TIevT UPVsckuYgtiYNvaCaxJzx9p/bt354SdnPTiltRmoCQvs0CJHv1tkcCvgG6rWROe0oq1w 6STDnNZhxKT42fZqq4zvlssu9W5Mq6aAnfiZaDOi+yJU1KwR+auy2G6MYbzHbjg2FHp2 xrr7FxWZkAGBFmmM5BOniwysgpmI7awm/baLA0yv4X1bzNfytPRpQZN8JABx9QCoeweK q4VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=dkl/nBUaeMYckUhTpbzntN/k0eYYaext61DY4UGDyHA=; b=fU6a6RLB7tdHjOZqyoO8ZBmYPmgW0Uo7E1KPopjTbNx0JnBjXCFX3MsiHM2S4AcbYU OBcE9Uz35qDqrtwMjiY+nFUPlu7+gTpq183ePrEa4eRCEhKSW3nEdm69fJBfCL0saIQU XmoEAXcMwhs7eyBeSOLnHHSrWFbu2z33uwt4MdPzx0YhbDeNXiQRJp9h6O8/t0ELrCPI niPoO9N/xMhGvY/mhxkk9OfxN9Y5eyFp3I3btcAEluRk82lIwv4bJHtTii5vE01sZ1E1 +7Kqf0vTyoIABtN0JnmKygZHvLh/qtQEH1j49LbSioOFehPVP2FjIkPNh14l8WJ+zJ4S SQ5w== X-Gm-Message-State: AFqh2kqVFC9OdL9iIrT0LvmrKeMLSSFD87L0Gd/DHa3MRQzghS/R6nLa NUXpNfCqDMnYq8kZf8KiRXA= X-Google-Smtp-Source: AMrXdXvp4QEhzR93wkw3GxDcuH6OOpuHinyMKYaAfCB5z/9DQlRMZ1Zf/WcCNFqVKooyRJeeWU/uwA== X-Received: by 2002:a05:600c:500a:b0:3d3:5b56:b834 with SMTP id n10-20020a05600c500a00b003d35b56b834mr10052860wmr.5.1671922077731; Sat, 24 Dec 2022 14:47:57 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id bg40-20020a05600c3ca800b003b4cba4ef71sm15086770wmb.41.2022.12.24.14.47.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 24 Dec 2022 14:47:56 -0800 (PST) Content-Type: multipart/mixed; boundary="------------uNplxyzux48Pc0CWiW8q8lEJ" Message-ID: Date: Sun, 25 Dec 2022 00:47:55 +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#60186: 29.0.60; ruby-mode indentation of multi-line expressions 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> From: Dmitry Gutov In-Reply-To: X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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 (-) This is a multi-part message in MIME format. --------------uNplxyzux48Pc0CWiW8q8lEJ Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 24/12/2022 02:17, Aaron Jensen wrote: > On Fri, Dec 23, 2022 at 5:26 PM Dmitry Gutov wrote: >> >> Is that also true for the other "codebases you've seen" referred to in >> the first message here? > > Mostly we work with Rails (and I try to avoid looking at that code as > much as I can, though I often find myself in there...) and the > Eventide framework: https://github.com/eventide-project Thanks. It's very neat. I couldn't find any big app in there, though. And that's where the things tend to become more hairy. > Given that the two founders of that are on my team we tend to follow > their indentation and coding style (and it is well-thought out, with > everything considered with respect to human cognition/eye tracking > studies/etc.). That's probably the best example I could offer, though > what you will find in there is that not many lines of code span more > than one line. They (and we) tend to allow longer lines when the right > side of the line is less important. With code rarely spanning multiple lines, the current indentation logic of ruby-mode is probably working fine too. >>> With either indentation style, the >>> first argument (which is the most significant one when a method is >>> properly designed) will have the least presence when scanning. It's >>> just not a good format in my experience. In our code we take it a step >>> further and always use parentheses except for in class level "macros". >> >> That's also my preference and true of the code I've seen. But "class >> level macros" are often an important part of projects, be that >> ActiveRecord validations, or DSL-like calls in Grape (routes, params, etc). >> >> So I wonder whether we should alter parenless calls' indentation for the >> "simplified" style. > > I think I would tend towards saying yes, make it simple/like the chef > codebase. That's consistent and if one wants to line things up, then > one can use parens, even with class level macros (or use long lines > and not care). All right. In the latest iteration of the patch (attached) I've split off the block's indentation behavior into a separate option and altered the indentation of the parenless calls. In the more complex cases the results are definitely interesting: method arg1, method2 arg2, arg3 zzz = method (a + b), c, :d => :e, f: g >> Though they also like to line up the keyword arguments according to >> Rubocop's defaults >> (https://github.com/spree/spree/blob/main/core/app/models/spree/product.rb#L63), >> something we don't support yet. > > This line is rather painful to read and inconsistent with the call > just below it on line 70. I would certainly not advocate for that. I think it's consistent in the sense that the "keyword" section of the arguments is vertically aligned in both cases. It's a popular Rubocop rule, apparently. Whether it's useful, though, I'm doubtful too. >> Do you have a source-available example of a project in your preferred >> coding style? >> >> Chef, perhaps? >> >> https://github.com/chef/chef/blob/main/lib/chef/application/base.rb >> https://github.com/chef/chef/blob/main/lib/chef/application/client.rb > > Yeah, I think this is probably the closest with regard to indentation > aside from Eventide, but again, you won't find much indentation there. > Whatever you find will likely be Vim's default, which I believe is the > same simple two space indent we are discussing. Okay. >>> This means that any time we decide to split a method invocation on >>> multiple lines we use the basic newline after ( style. >> >> For "class-level macros" as well? > > I found inconsistencies in our codebase, so it is time for us to > establish a new norm. My guess is that we will land on using parens > for it. When we do it without parens, it is in the simplified style. > > Thank you for your research and work on this, I appreciate it. Thank you too. 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. --------------uNplxyzux48Pc0CWiW8q8lEJ Content-Type: text/x-patch; charset=UTF-8; name="ruby-simplified-indent-v5.diff" Content-Disposition: attachment; filename="ruby-simplified-indent-v5.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVzL3J1YnktbW9kZS5lbCBiL2xpc3AvcHJvZ21v ZGVzL3J1YnktbW9kZS5lbAppbmRleCBhNGFhNjE5MDVlNC4uMmZlMWY0OTg2ZWUgMTAwNjQ0 Ci0tLSBhL2xpc3AvcHJvZ21vZGVzL3J1YnktbW9kZS5lbAorKysgYi9saXNwL3Byb2dtb2Rl cy9ydWJ5LW1vZGUuZWwKQEAgLTI4NSw2ICsyODUsNDAgQEAgcnVieS1tZXRob2QtcGFyYW1z LWluZGVudAogICA6c2FmZSAobGFtYmRhICh2YWwpIChvciAobWVtcSB2YWwgJyh0IG5pbCkp IChudW1iZXJwIHZhbCkpKQogICA6dmVyc2lvbiAiMjkuMSIpCiAKKyhkZWZjdXN0b20gcnVi eS1ibG9jay1pbmRlbnQgdAorICAiTm9uLW5pbCB0byBhbGlnbiB0aGUgYm9keSBvZiBhIGJs b2NrIHRvIHRoZSBzdGF0ZW1lbnQncyBzdGFydC4KKworVGhlIGJvZHkgYW5kIHRoZSBjbG9z ZXIgd2lsbCBiZSBhbGlnbmVkIHRvIHRoZSBjb2x1bW4gd2hlcmUgdGhlCitzdGF0ZW1lbnQg Y29udGFpbmluZyB0aGUgYmxvY2sgc3RhcnRzLiBFeGFtcGxlOgorCisgIGZvby5iYXIKKyAg ICAuZWFjaCBkbworICAgIGJhegorICBlbmQKKworSWYgbmlsLCBpdCB3aWxsIGJlIGFsaWdu ZWQgaW5zdGVhZCB0byB0aGUgYmVnaW5uaW5nIG9mIHRoZSBsaW5lC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CAi PyIpCiAgICAgICAgKG5vbmFzc29jICIuLiIgIi4uLiIpCiAgICAgICAgKGxlZnQgIiYmIiAi fHwiKQogICAgICAgIChub25hc3NvYyAiPD0+IikKQEAgLTYwOCwxMCArNjQzLDEwIEBAIHJ1 Ynktc21pZS0tYmFja3dhcmQtdG9rZW4KICAgICAgICAgICAiZGVmPSIpCiAgICAgICAgICAo dCB0b2spKSkpKSkpCiAKLShkZWZ1biBydWJ5LXNtaWUtLWluZGVudC10by1zdG10ICgpCiso ZGVmdW4gcnVieS1zbWllLS1pbmRlbnQtdG8tc3RtdCAoJm9wdGlvbmFsIG9mZnNldCkKICAg KHNhdmUtZXhjdXJzaW9uCiAgICAgKHNtaWUtYmFja3dhcmQtc2V4cCAiOyIpCi0gICAgKGNv bnMgJ2NvbHVtbiAoc21pZS1pbmRlbnQtdmlydHVhbCkpKSkKKyAgICAoY29ucyAnY29sdW1u ICgrIChzbWllLWluZGVudC12aXJ0dWFsKSAob3Igb2Zmc2V0IDApKSkpKQogCiAoZGVmdW4g cnVieS1zbWllLS1pbmRlbnQtdG8tc3RtdC1wIChrZXl3b3JkKQogICAob3IgKGVxIHQgcnVi eS1hbGlnbi10by1zdG10LWtleXdvcmRzKQpAQCAtNjQyLDcgKzY3Nyw5IEBAIHJ1Ynktc21p ZS1ydWxlcwogICAgICAgICAgICAgICAoZm9yd2FyZC1jb21tZW50IC0xKQogICAgICAgICAg ICAgICAobm90IChlcSAocHJlY2VkaW5nLWNoYXIpID86KSkpKQogICAgICAgIDs7IEN1cmx5 IGJsb2NrIG9wZW5lci4KLSAgICAgICAocnVieS1zbWllLS1pbmRlbnQtdG8tc3RtdCkpCisg ICAgICAgKGlmIHJ1YnktYmxvY2staW5kZW50CisgICAgICAgICAgIChydWJ5LXNtaWUtLWlu ZGVudC10by1zdG10KQorICAgICAgICAgKGNvbnMgJ2NvbHVtbiAoY3VycmVudC1pbmRlbnRh dGlvbikpKSkKICAgICAgICgoc21pZS1ydWxlLWhhbmdpbmctcCkKICAgICAgICA7OyBUcmVh dCBwdXJlbHkgc3ludGFjdGljIGJsb2NrLWNvbnN0cnVjdHMgYXMgYmVpbmcgcGFydCBvZiB0 aGVpciBwYXJlbnQsCiAgICAgICAgOzsgd2hlbiB0aGUgb3BlbmluZyB0b2tlbiBpcyBoYW5n aW5nIGFuZCB0aGUgcGFyZW50IGlzIG5vdCBhbgpAQCAtNjc4LDEyICs3MTUsMTYgQEAgcnVi eS1zbWllLXJ1bGVzCiAgICAgICAgICAoY29ucyAnY29sdW1uIChjdXJyZW50LWNvbHVtbikp KSkpCiAgICAgKCcoOmJlZm9yZSAuICIgQCAiKQogICAgICAoaWYgKG9yIChlcSBydWJ5LW1l dGhvZC1wYXJhbXMtaW5kZW50IHQpCisgICAgICAgICAgICAgKGVxIHJ1YnktaW5kZW50LXNp bXBsaWZpZWQgbmlsKQogICAgICAgICAgICAgIChub3QgKHNtaWUtcnVsZS1wYXJlbnQtcCAi ZGVmIiAiZGVmPSIpKSkKICAgICAgICAgIChzYXZlLWV4Y3Vyc2lvbgogICAgICAgICAgICAo c2tpcC1jaGFycy1mb3J3YXJkICIgXHQiKQogICAgICAgICAgICAoY29ucyAnY29sdW1uIChj dXJyZW50LWNvbHVtbikpKQogICAgICAgIChzbWllLXJ1bGUtcGFyZW50IChvciBydWJ5LW1l dGhvZC1wYXJhbXMtaW5kZW50IDApKSkpCi0gICAgKCcoOmJlZm9yZSAuICJkbyIpIChydWJ5 LXNtaWUtLWluZGVudC10by1zdG10KSkKKyAgICAoJyg6YmVmb3JlIC4gImRvIikKKyAgICAg KGlmIHJ1YnktYmxvY2staW5kZW50CisgICAgICAgICAocnVieS1zbWllLS1pbmRlbnQtdG8t c3RtdCkKKyAgICAgICAoY29ucyAnY29sdW1uIChjdXJyZW50LWluZGVudGF0aW9uKSkpKQog ICAgICgnKDpiZWZvcmUgLiAiLiIpCiAgICAgIChpZiAoc21pZS1ydWxlLXNpYmxpbmctcCkK ICAgICAgICAgICh3aGVuIHJ1YnktYWxpZ24tY2hhaW5lZC1jYWxscwpAQCAtNjk2LDggKzcz NywxMCBAQCBydWJ5LXNtaWUtcnVsZXMKICAgICAgICAgICAgICAgICAgICAobm90IChzbWll LXJ1bGUtYm9scCkpKSkpCiAgICAgICAgICAgIChjb25zICdjb2x1bW4gKGN1cnJlbnQtY29s dW1uKSkpCiAgICAgICAgKHNtaWUtYmFja3dhcmQtc2V4cCAiLiIpCi0gICAgICAgKGNvbnMg J2NvbHVtbiAoKyAoY3VycmVudC1jb2x1bW4pCi0gICAgICAgICAgICAgICAgICAgICAgICBy dWJ5LWluZGVudC1sZXZlbCkpKSkKKyAgICAgICAoaWYgcnVieS1pbmRlbnQtc2ltcGxpZmll ZAorICAgICAgICAgICAocnVieS1zbWllLS1pbmRlbnQtdG8tc3RtdCBydWJ5LWluZGVudC1s ZXZlbCkKKyAgICAgICAgIChjb25zICdjb2x1bW4gKCsgKGN1cnJlbnQtY29sdW1uKQorICAg ICAgICAgICAgICAgICAgICAgICAgICBydWJ5LWluZGVudC1sZXZlbCkpKSkpCiAgICAgKGAo OmJlZm9yZSAuICwob3IgImVsc2UiICJ0aGVuIiAiZWxzaWYiICJyZXNjdWUiICJlbnN1cmUi KSkKICAgICAgKHNtaWUtcnVsZS1wYXJlbnQpKQogICAgIChgKDpiZWZvcmUgLiAsKG9yICJ3 aGVuIiAiaW4iKSkKQEAgLTcxMCwxNCArNzUzLDE2IEBAIHJ1Ynktc21pZS1ydWxlcwogICAg ICAgICAgICAgICAgICAgICAgIjw8PSIgIj4+PSIgIiYmPSIgInx8PSIgImFuZCIgIm9yIikp CiAgICAgIChhbmQgKHNtaWUtcnVsZS1wYXJlbnQtcCAiOyIgbmlsKQogICAgICAgICAgIChz bWllLWluZGVudC0taGFuZ2luZy1wKQotICAgICAgICAgIHJ1YnktaW5kZW50LWxldmVsKSkK KyAgICAgICAgICAoaWYgcnVieS1pbmRlbnQtc2ltcGxpZmllZAorICAgICAgICAgICAgICAo cnVieS1zbWllLS1pbmRlbnQtdG8tc3RtdCBydWJ5LWluZGVudC1sZXZlbCkKKyAgICAgICAg ICAgIHJ1YnktaW5kZW50LWxldmVsKSkpCiAgICAgKGAoOmJlZm9yZSAuICI9IikKICAgICAg KHNhdmUtZXhjdXJzaW9uCiAgICAgICAoYW5kIChzbWllLXJ1bGUtcGFyZW50LXAgIiBAICIp CiAgICAgICAgICAgIChnb3RvLWNoYXIgKG50aCAxIChzbWllLWluZGVudC0tcGFyZW50KSkp CiAgICAgICAgICAgIChzbWllLXJ1bGUtcHJldi1wICJkZWY9IikKICAgICAgICAgICAgKGNv bnMgJ2NvbHVtbiAoKyAoY3VycmVudC1jb2x1bW4pIHJ1YnktaW5kZW50LWxldmVsIC0zKSkp KSkKLSAgICAoYCg6YWZ0ZXIgLiAsKG9yICI/IiAiOiIpKSBydWJ5LWluZGVudC1sZXZlbCkK KyAgICAoYCg6YWZ0ZXIgLiAsKG9yICI/IiAiOiIpKSAodW5sZXNzIHJ1YnktaW5kZW50LXNp bXBsaWZpZWQgcnVieS1pbmRlbnQtbGV2ZWwpKQogICAgIChgKDpiZWZvcmUgLiAsKGd1YXJk IChtZW1xIChpbnRlcm4tc29mdCB0b2tlbikgcnVieS1hbGlnbmFibGUta2V5d29yZHMpKSkK ICAgICAgKHdoZW4gKG5vdCAocnVieS0tYXQtaW5kZW50YXRpb24tcCkpCiAgICAgICAgKGlm IChydWJ5LXNtaWUtLWluZGVudC10by1zdG10LXAgdG9rZW4pCkBAIC03MjUsNyArNzcwLDIx IEBAIHJ1Ynktc21pZS1ydWxlcwogICAgICAgICAgKGNvbnMgJ2NvbHVtbiAoY3VycmVudC1j b2x1bW4pKSkpKQogICAgICgnKDpiZWZvcmUgLiAiaXV3dS1tb2QiKQogICAgICAoc21pZS1y dWxlLXBhcmVudCBydWJ5LWluZGVudC1sZXZlbCkpCi0gICAgKSkKKyAgICAoYCg6YmVmb3Jl IC4gIiwiKQorICAgICAoYW5kIHJ1YnktaW5kZW50LXNpbXBsaWZpZWQKKyAgICAgICAgICAo c21pZS1ydWxlLXBhcmVudC1wICIgQCAiKQorICAgICAgICAgIChydWJ5LXNtaWUtLWluZGVu dC10by1zdG10IHJ1YnktaW5kZW50LWxldmVsKSkpCisgICAgKGAoOmJlZm9yZSAuICxfKQor ICAgICAod2hlbiAoYW5kIHJ1YnktaW5kZW50LXNpbXBsaWZpZWQKKyAgICAgICAgICAgICAg ICAobm90IChvciAobWVtYmVyIHRva2VuICcoIiwiKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAoc21pZS1ydWxlLXByZXYtcCAiOyIpKSkpCisgICAgICAgKGxldCogKChzdG10LWJl ZyAoc2F2ZS1leGN1cnNpb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgKHNtaWUtYmFj a3dhcmQtc2V4cCAiOyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgIChwb2ludCkpKQor ICAgICAgICAgICAgICAobmxzICgxLSAoY291bnQtbGluZXMgc3RtdC1iZWcgKHBvaW50KSkp KSkKKyAgICAgICAgICh3aGVuIChzbWllLWluZGVudC0taGFuZ2luZy1wKQorICAgICAgICAg ICAoY2wtaW5jZiBubHMpKQorICAgICAgICAgKHJ1Ynktc21pZS0taW5kZW50LXRvLXN0bXQg KGlmICg+IG5scyAwKSBydWJ5LWluZGVudC1sZXZlbCAwKSkpKSkpKQogCiAoZGVmdW4gcnVi eS0tYXQtaW5kZW50YXRpb24tcCAoJm9wdGlvbmFsIHBvaW50KQogICAoc2F2ZS1leGN1cnNp b24KZGlmZiAtLWdpdCBhL3Rlc3QvbGlzcC9wcm9nbW9kZXMvcnVieS1tb2RlLXJlc291cmNl cy9ydWJ5LWJsb2NrLWluZGVudC5yYiBiL3Rlc3QvbGlzcC9wcm9nbW9kZXMvcnVieS1tb2Rl LXJlc291cmNlcy9ydWJ5LWJsb2NrLWluZGVudC5yYgpuZXcgZmlsZSBtb2RlIDEwMDY0NApp bmRleCAwMDAwMDAwMDAwMC4uMDNhY2RkYT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AicnVi eS5yYiIpCiAocnVieS1kZWZ0ZXN0LWluZGVudCAicnVieS1tZXRob2QtcGFyYW1zLWluZGVu dC5yYiIpCisocnVieS1kZWZ0ZXN0LWluZGVudCAicnVieS1pbmRlbnQtc2ltcGxpZmllZC5y YiIpCisocnVieS1kZWZ0ZXN0LWluZGVudCAicnVieS1ibG9jay1pbmRlbnQucmIiKQogCiAo ZXJ0LWRlZnRlc3QgcnVieS0tdGVzdC1jaGFpbmVkLWluZGVudGF0aW9uICgpCiAgICh3aXRo LXRlbXAtYnVmZmVyCg== --------------uNplxyzux48Pc0CWiW8q8lEJ-- From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 24 19:13:03 2022 Received: (at 60186) by debbugs.gnu.org; 25 Dec 2022 00:13:03 +0000 Received: from localhost ([127.0.0.1]:47335 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9EdS-0003fK-7I for submit@debbugs.gnu.org; Sat, 24 Dec 2022 19:13:02 -0500 Received: from mail-pj1-f43.google.com ([209.85.216.43]:40860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9EdN-0003ek-1b for 60186@debbugs.gnu.org; Sat, 24 Dec 2022 19:13:00 -0500 Received: by mail-pj1-f43.google.com with SMTP id c8-20020a17090a4d0800b00225c3614161so4810759pjg.5 for <60186@debbugs.gnu.org>; Sat, 24 Dec 2022 16:12:57 -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=GYmTTB0uzTKIbJmMp5TvwJTNSvSvOe0Dd53uiySZibQ=; b=NwjhOH1SZYvqQM08hdDJN3JMiQ2UF9rS4g5wHMiu9aggAHfB0iNHF+VDHQSrCutSQA HtbimBz8V5TQkMKzO3gBrmiW4Ln++q3NBVAVBHjhXb+4pd0Amszdimpsx5iEaWfnGyWv 3XnGBuhxCHUrV6mbaBZGq+Uf0occTqOzsDQf250sPYSBjfWtKdwpNj4uuONwdMXhiBkG Wf5+DWss/hAcQAb3v7fcfDuhdz0SUoVfQ8pnaH/wwq5JPHuHgXNGU+dIzvvvtkuoDhqc r14Fegqr0HWOJM+4Osk4jVluynWSbFb4dQTm9rbvRhbuwaoR6q+hu92gGK1RUrNyXj1J AQ1A== 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=GYmTTB0uzTKIbJmMp5TvwJTNSvSvOe0Dd53uiySZibQ=; b=wceqdF/nfAKhh6M+Wg7WlCCu+1ijVbVGHsAF0SbkSEQS+Q3aYd1ADJP45mpgbp40XT nN/Hs2DqNOJdFSBMLUAh+FXvzcbcd8CydaLcNYYi8gwVemQz7iwfzUN1MIhKDBcgNBIT Dp4c2rG8CDltWtKWTkMOkE+tYbXmwys8fBDthC4LPH6gctFcw/HHTjw+RgtV45ySXgJH N2/pBXCbm72G752DayW/QlNz9VldgHlvQEDrrjiCXwr6qgAf8fKQ3st555ONd0fOjwQG sFEwqUHSvxtAZO0EPCrVftsWmKOXbn61G6eQiWed730D/BadDsHW6quw2DU80WhQUgH+ HE3Q== X-Gm-Message-State: AFqh2kq3vskEvmJ1LaxZp+lyi+YBjo4dfHou2SRHxU0UJA5bAcK64yME XZjP/vYfz3/REf7AnprXTmeXjKrQ+lXUnabbNNI= X-Google-Smtp-Source: AMrXdXuf6B8uhOdhli53gC8/i7OD1+Knb52pOBYIXwN6v5Hx5kmJvnWLqqOyLpX5Dv/L2NWRxFsQxf2Nb/VnRGgeGFQ= X-Received: by 2002:a17:90b:d8a:b0:223:f336:1519 with SMTP id bg10-20020a17090b0d8a00b00223f3361519mr1097797pjb.198.1671927170999; Sat, 24 Dec 2022 16:12:50 -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> In-Reply-To: From: Aaron Jensen Date: Sat, 24 Dec 2022 19:12:39 -0500 Message-ID: Subject: Re: bug#60186: 29.0.60; ruby-mode indentation of multi-line expressions To: Dmitry Gutov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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 Sat, Dec 24, 2022 at 5:47 PM Dmitry Gutov wrote: > > On 24/12/2022 02:17, Aaron Jensen wrote: > > On Fri, Dec 23, 2022 at 5:26 PM Dmitry Gutov wrote: > >> > >> Is that also true for the other "codebases you've seen" referred to in > >> the first message here? > > > > Mostly we work with Rails (and I try to avoid looking at that code as > > much as I can, though I often find myself in there...) and the > > Eventide framework: https://github.com/eventide-project > > Thanks. It's very neat. I couldn't find any big app in there, though. > And that's where the things tend to become more hairy. Funny thing, that. That's intentional. Our client's codebase we built doesn't have any big apps either. Different subject though. > > Given that the two founders of that are on my team we tend to follow > > their indentation and coding style (and it is well-thought out, with > > everything considered with respect to human cognition/eye tracking > > studies/etc.). That's probably the best example I could offer, though > > what you will find in there is that not many lines of code span more > > than one line. They (and we) tend to allow longer lines when the right > > side of the line is less important. > > With code rarely spanning multiple lines, the current indentation logic > of ruby-mode is probably working fine too. We see more in our application (and that's closed source, so I cannot share it). Suffice it to say, it came up enough that all the Emacs users on our team have had trouble with it, so this work will be appreciated. > >>> With either indentation style, the > >>> first argument (which is the most significant one when a method is > >>> properly designed) will have the least presence when scanning. It's > >>> just not a good format in my experience. In our code we take it a step > >>> further and always use parentheses except for in class level "macros". > >> > >> That's also my preference and true of the code I've seen. But "class > >> level macros" are often an important part of projects, be that > >> ActiveRecord validations, or DSL-like calls in Grape (routes, params, etc). > >> > >> So I wonder whether we should alter parenless calls' indentation for the > >> "simplified" style. > > > > I think I would tend towards saying yes, make it simple/like the chef > > codebase. That's consistent and if one wants to line things up, then > > one can use parens, even with class level macros (or use long lines > > and not care). > > All right. In the latest iteration of the patch (attached) I've split > off the block's indentation behavior into a separate option and altered > the indentation of the parenless calls. > > In the more complex cases the results are definitely interesting: > > method arg1, > method2 arg2, > arg3 I don't know what I'd expect here, other than to have a conversation with the dev who wrote it to explain why we use parentheses :) In other words, I'm fine with this indentation and I couldn't even tell you the precedence here off the top of my head. > zzz = method (a + b), > c, :d => :e, > f: g Yeah, this looks right to me too. > >> Though they also like to line up the keyword arguments according to > >> Rubocop's defaults > >> (https://github.com/spree/spree/blob/main/core/app/models/spree/product.rb#L63), > >> something we don't support yet. > > > > This line is rather painful to read and inconsistent with the call > > just below it on line 70. I would certainly not advocate for that. > > I think it's consistent in the sense that the "keyword" section of the > arguments is vertically aligned in both cases. It's a popular Rubocop > rule, apparently. > > Whether it's useful, though, I'm doubtful too. > > >> Do you have a source-available example of a project in your preferred > >> coding style? > >> > >> Chef, perhaps? > >> > >> https://github.com/chef/chef/blob/main/lib/chef/application/base.rb > >> https://github.com/chef/chef/blob/main/lib/chef/application/client.rb > > > > Yeah, I think this is probably the closest with regard to indentation > > aside from Eventide, but again, you won't find much indentation there. > > Whatever you find will likely be Vim's default, which I believe is the > > same simple two space indent we are discussing. > > Okay. > > >>> This means that any time we decide to split a method invocation on > >>> multiple lines we use the basic newline after ( style. > >> > >> For "class-level macros" as well? > > > > I found inconsistencies in our codebase, so it is time for us to > > establish a new norm. My guess is that we will land on using parens > > for it. When we do it without parens, it is in the simplified style. > > > > Thank you for your research and work on this, I appreciate it. > > Thank you too. > > 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 ] ) 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 ] ) I would not even attempt to explain why in this situation they rely on lining up parens, but this is what they do. So, we could either emulate this, or chart our own course. I would have expected it to look like the example I gave with the ] and ) both at the beginning of the line with no indentation. The Vim way looks worse though, which in this instance may be a feature :) Aaron From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 24 19:14:49 2022 Received: (at 60186) by debbugs.gnu.org; 25 Dec 2022 00:14:49 +0000 Received: from localhost ([127.0.0.1]:47339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9EfB-0003kM-5z for submit@debbugs.gnu.org; Sat, 24 Dec 2022 19:14:49 -0500 Received: from mail-pg1-f171.google.com ([209.85.215.171]:38700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9Ef9-0003jz-98 for 60186@debbugs.gnu.org; Sat, 24 Dec 2022 19:14:47 -0500 Received: by mail-pg1-f171.google.com with SMTP id w37so5390263pga.5 for <60186@debbugs.gnu.org>; Sat, 24 Dec 2022 16:14:47 -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=19qVpb+IPHvRzqhLMxmoOSwF5nZfxdLNyfaxpfPzr0w=; b=DxR9KNqXaspfpW4BdUpslcLnMEIBXbhd9wF0aghAaKYP5phlBLQFughGVnICRf5zHS 5pku2J7g4FW7ylqNEwnYRaT8Qxa2Rq6aZ1h7GdlLa6i0uHP1K3HEgUF5xior+ZpQA3Y6 V+OUgQkgRYONMmPkxjRs0jDSq4XqImNaUK9baUGb/QNtu66OaBX+DykcYz9hX9yDs0NR vtBzN0bAuSkjUGCadHigpbAKD9U9WBnYU3VFosGTavwNnLyAj8V5b2VoqOMGWdfXRdQT F0kMR+/5HLSOcgfxdAOH13gkylHbuCTTMSanS1sSiiIPGl80Vkfe//2WM0HVluhvyz+h F44A== 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=19qVpb+IPHvRzqhLMxmoOSwF5nZfxdLNyfaxpfPzr0w=; b=I6h3DvNDqhr8LmmPAeRbwXOnYNa7RvbM3k2MMARI/H+wW2R+RS8xxAzQfBES1oqFl6 8R1HaJ6gKjIKMR/o+5Pl3KN6pm6Hlxk1p81pVyM0CHJbKr0pjDabRjxgxY++U57M5V58 wfuW/t3FYYU20INz+OrfbwpuZGEkPKwmlmJiHA6XYz8TfvV+XAkkXxmcvc5GM9jnLxsh jmI+itaH81MqNvfbbOgP/U/DWE4e231kAfeMaINiTSjBm8jnQguYv+KEUTrsDXgNS/sk iWzPCwjDUY0t7O4uC9CosYRMC3A8ZlFrh5p+oYqbMYr64q2chVfFUk1Gi0rGGhepO6a+ yKmQ== X-Gm-Message-State: AFqh2krWBYRy011NYIQa7hfZqgesuu5agy/pe5KMqFfmhfu/+3MpUt3p dslGy8zSO+QD3oFUiKlAdgwH5ScWQgMiiw/uPSw= X-Google-Smtp-Source: AMrXdXvlODHxRJsMqjwem/RNKIfYQiod1LB1agasWQWGbLN4ZUiGsMTmzjhLbDwKkc2zkhBuXF0SwT4SsTOcMY5e3Qs= X-Received: by 2002:a65:4c81:0:b0:486:f3bf:822e with SMTP id m1-20020a654c81000000b00486f3bf822emr821721pgt.482.1671927281590; Sat, 24 Dec 2022 16:14:41 -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> In-Reply-To: From: Aaron Jensen Date: Sat, 24 Dec 2022 19:14:30 -0500 Message-ID: Subject: Re: bug#60186: 29.0.60; ruby-mode indentation of multi-line expressions To: Dmitry Gutov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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 Sat, Dec 24, 2022 at 5:47 PM Dmitry Gutov wrote: > > All right. In the latest iteration of the patch (attached) I've split > off the block's indentation behavior into a separate option and altered > the indentation of the parenless calls. I forgot to mention that I tried the patch out and it seems to work well with: (setq ruby-indent-simplified t ruby-block-indent nil) Those are the only two I should be setting, correct? Thanks, Aaron From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 25 16:23:56 2022 Received: (at submit) by debbugs.gnu.org; 25 Dec 2022 21:23:56 +0000 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 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 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 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 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) 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) Message-ID: <154f41d0-c491-b105-d622-3c7d7203f37b@yandex.ru> Date: Sun, 25 Dec 2022 23:23:45 +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#60186: 29.0.60; ruby-mode indentation of multi-line expressions Content-Language: en-US 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> From: Dmitry Gutov 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::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-Spam-Score: -1.2 (-) 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: -3.2 (---) 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. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 25 16:29:53 2022 Received: (at 60186) by debbugs.gnu.org; 25 Dec 2022 21:29:53 +0000 Received: from localhost ([127.0.0.1]:50202 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9YZ6-0002dH-QL for submit@debbugs.gnu.org; Sun, 25 Dec 2022 16:29:53 -0500 Received: from mail-wm1-f48.google.com ([209.85.128.48]:54197) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9YZ4-0002d1-8P for 60186@debbugs.gnu.org; Sun, 25 Dec 2022 16:29:50 -0500 Received: by mail-wm1-f48.google.com with SMTP id ja17so6727244wmb.3 for <60186@debbugs.gnu.org>; Sun, 25 Dec 2022 13:29:50 -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=vckmokxwAUOjQcn0H9cSL9mHTX6jqoN/RotYj2Narcs=; b=VKoLmnejMv8TD1YtTGf2ALP0Pk26WKop54M7cEnJ5wQcxSkqaYFigA2IaKxor2JVW9 MHtBc4qiX4FtQ0Rx/2Nimq++nWYyHGvTKU3TO5KvuoyVQP0ffREGf/0yde+tF10k8iKm ZoJSY4+R3bdyWC2cNzBpetjW5xfpxpAR5SmT0426SxsoSUZxt2VYqiXeNuM50/3itvgy JA3LUJ2Gfiz7847VJ3TyH/8enxv9KCiZtA8Bj/kR+Vu3ucyJCWU7S2w+guxeQbAwe7r1 1z6toAOpE7S2yOduWQUbtEX54dDHi0Q7b1fp3mcdOBWbziIyM8jacb7IgswhpZiPrqxL H7Ig== 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=vckmokxwAUOjQcn0H9cSL9mHTX6jqoN/RotYj2Narcs=; b=5Txw0vHVDWREKq6DeOxxTuBq1F+kr2kEv4bPglxWdwzhCvvhUjPP7cHQzT3YTBsQRd x7dRrKlsQ0SgD+BPgFuqFheu+hQS7j9IRyrxJU15KEc37ZrJl6MP7dodq+RpCtxw0MhY QkTgKqIUb6CjbNtytzjZGguvMO/nRMMx4viVZAAbunt3J2tfR4gNlsDAHf0oB/3Cavja FYi9DQJgwI44vqokC7YQEWTMqa6aUJycou0FZ6Hg37uCBnl1lkaDFkaOlNbvCAfUGqpp B55LJQj0Cf09nwaETn6bjc7ZP5+tfqXrYEfcAL7J11ljFk4gsIJxhGhXFxOucsKHt1p/ 0PuA== X-Gm-Message-State: AFqh2koea0E1iNQRTwkviunFpIHJOKrKlXGe+IClTTejHzi6QqvMuuuA 7DK+Lfq7vVtCXcEeqLfkQgE= X-Google-Smtp-Source: AMrXdXtNauadNipXaq4VQdwsciSsXVnkTQGMNesQvLRWyHR27+CBBnUwuMVwYTouLCAqtN1RGGja8g== X-Received: by 2002:a7b:c408:0:b0:3d5:64bf:ccc2 with SMTP id k8-20020a7bc408000000b003d564bfccc2mr11484702wmi.32.1672003784208; Sun, 25 Dec 2022 13:29:44 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id ay39-20020a05600c1e2700b003cfa80443a0sm11705367wmb.35.2022.12.25.13.29.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 25 Dec 2022 13:29:43 -0800 (PST) Message-ID: Date: Sun, 25 Dec 2022 23:29:42 +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#60186: 29.0.60; ruby-mode indentation of multi-line expressions 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> 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: 60186 Cc: 60186@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 25/12/2022 02:14, Aaron Jensen wrote: > On Sat, Dec 24, 2022 at 5:47 PM Dmitry Gutov wrote: >> All right. In the latest iteration of the patch (attached) I've split >> off the block's indentation behavior into a separate option and altered >> the indentation of the parenless calls. > I forgot to mention that I tried the patch out and it seems to work well with: > > (setq ruby-indent-simplified t > ruby-block-indent nil) > > Those are the only two I should be setting, correct? Yep. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 26 20:29:04 2022 Received: (at 60186) by debbugs.gnu.org; 27 Dec 2022 01:29:04 +0000 Received: from localhost ([127.0.0.1]:54396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9ym7-0000PD-Tu for submit@debbugs.gnu.org; Mon, 26 Dec 2022 20:29:04 -0500 Received: from mail-ej1-f48.google.com ([209.85.218.48]:39679) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9ym5-0000Oj-G6 for 60186@debbugs.gnu.org; Mon, 26 Dec 2022 20:29:02 -0500 Received: by mail-ej1-f48.google.com with SMTP id gh17so29017443ejb.6 for <60186@debbugs.gnu.org>; Mon, 26 Dec 2022 17:29:01 -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=Mj3uArN4BMdptbs3hIw12ib0hzY2GqOvAVbkQtHpfGo=; b=Ge2QfLRq6nY49aD9KucRu62d7l7sD31ZZYePOJQdMDwzG81sQWcT27JOUJjK5DuSRJ 9lJ1h5MDJriLxcMLelwO0E9fa5lOu+dpM6dKq37DX+Yp7SdpUyJzHNW0FTx0YMbBlruF rMoWiGTGeQqvR4zaHtv2SZk3CoKtt0p0s9MsqpLFyALw4JjN3Szsofi468RmJAZrr9rF LKF6Noa47e6NXmoXMUfx11nuHlU2LkciwTBOX8OfnqHRMsC27xSRGLiecqoJXsxqMgss XAmgiLHHHDA9vG8l+xyBth958XIfzK5PnlEruyAhEnLbNOMLNDVIaWgeCi09pjsv9R2F QbQA== 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=Mj3uArN4BMdptbs3hIw12ib0hzY2GqOvAVbkQtHpfGo=; b=euHGklwhzAbN6QY1PgU90j/zCa828IcUioTgtjZP5TITlpOAkHN2QlKvWDxe2pvsss yLX4eOwaVnp3jgfKMTr7+do74A/HXX091pkTH60KujigAc6tRuykcqz2IKzfS+s+ie8d XrtKs5x8TVUe8iFjpSabb2Rpa9/58w2CHV5FYe9AzjXIepSpmmuzs2lU1S2rd2nOU8p/ yHd01xvP7lkl3MmaPcuZXSdiosqXMNgn+74BVq1kgrQGp41TuPNeURKlenJPgeaOqRC0 i348rVZAAcWt6m3WX5N6jwftAdzG0Y3fyldSRxf2ODfKta6X0awO2EKVEv/o3N3tTVjz Orbw== X-Gm-Message-State: AFqh2kpYgEee6ReM4L/O4Ylpv4p4SaOTj9tdqZs0jAaNbHDpj+E+dTns F0aNbS15bQ4fYm+sZsBO3mo= X-Google-Smtp-Source: AMrXdXsYO7DravG6UBo/HhB0L0MbhB7eGv1oDGn2NLJI7pYKPFTqDADxrlTeXiNDaJTIC6EVTSsOCA== X-Received: by 2002:a17:907:8a20:b0:7c0:cfb2:40d2 with SMTP id sc32-20020a1709078a2000b007c0cfb240d2mr21423987ejc.64.1672104535574; Mon, 26 Dec 2022 17:28:55 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id 10-20020a170906300a00b007c53090d511sm5395363ejz.192.2022.12.26.17.28.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Dec 2022 17:28:55 -0800 (PST) Message-ID: <688159e9-f6bc-f233-08c4-9834bc00c455@yandex.ru> Date: Tue, 27 Dec 2022 03:28:53 +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#60186: 29.0.60; ruby-mode indentation of multi-line expressions 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> 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: 60186 Cc: 60186@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 25/12/2022 02:14, Aaron Jensen wrote: > (setq ruby-indent-simplified t BTW, do you have any opinion on the name? Perhaps something more semantic would be easier to discover. A recent tree-sitter thread brought up sh-indent-after-continuation. It's not a direct counterpart, though, and the examples only look remotely similar. Call ours ruby-indent-continuations-simplified, maybe? Now that we seem to have reduced its scope to expression continuations across newlines. Hopefully it won't be confused with Kernel#callcc. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 26 20:48:04 2022 Received: (at 60186) by debbugs.gnu.org; 27 Dec 2022 01:48:04 +0000 Received: from localhost ([127.0.0.1]:54405 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9z4V-0000uS-W2 for submit@debbugs.gnu.org; Mon, 26 Dec 2022 20:48:04 -0500 Received: from mail-pl1-f178.google.com ([209.85.214.178]:33720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9z4T-0000tP-VN for 60186@debbugs.gnu.org; Mon, 26 Dec 2022 20:48:03 -0500 Received: by mail-pl1-f178.google.com with SMTP id 17so12022213pll.0 for <60186@debbugs.gnu.org>; Mon, 26 Dec 2022 17:48:01 -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=Cf0Z94Xe6kjQT6Du2XDD8NHgIgCMlrfB3wmEDUjxXZA=; b=R9XzFYxYD4c9UZNPA4ZjINrUrkDb6QWJQUHkAqs9LtCJcKdV/T7/7iDfy3sfMKd7bK koo8kKx2EiiwXeWfX4TZOxB0gIZx5TWEwzlC+gNcvX/GLCewOkBj/+M3GDksQoLlOjyo zan6V9yjpR5u42KHk61zF+EFwVyX3DU6PceUbHP2S2v9lPquyl+QPTim5mSAOchSBW3A E4vxNqNExkBA5LmUvRwaID43/ztFcKU2AffM5l5f/4ciQcYM1mHtAnCbETDZxAxrbTGm hNfPPyXcfYGExpIovfzdHFxabWPhLxRqkIVNtgzhO3GBQVloJ8nZHTbAzNBFkwaStG46 8e3w== 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=Cf0Z94Xe6kjQT6Du2XDD8NHgIgCMlrfB3wmEDUjxXZA=; b=gzdREWdl5mIjNKJcBIub6MeXmoX+5eqVVCkmnRDIYECHPPJw2Kjy5DOum2iBkz5cch JNM9VqUXYKzsUg4lJ0fkOswQTIey3QKl5+rpFrgY9W4bO8CnMllBXsuLl16jhNoy2U0K EoH9izgS/Yk3QEhEzqaEeYzfSwjB73FnoMrkG6uQkXnCDLyYyqTZceirl2rtWi5g/d6s 8CWE5PGqnS+KVZf1Yrw7BRb3UDhgMw9JbpxX2DPMdUW8ajHYoVasxD6iip/caAnlfBm2 /igzNozkWftjjZxyQtdpVStyE0lvP3/N4CP8yOt4sk978cctVBon3DQeq7bEEKriNYBC qziA== X-Gm-Message-State: AFqh2koMVFnn/a4ibK1ypUhZCrkTCrF/lXKdfRa1dnCZDZiCxdw/oeZ0 MEgaoB4mERaZXLTCLigKxX3nRIMcoG1519uevoE= X-Google-Smtp-Source: AMrXdXs2Me/hjYB6hzHqGX1mqbJWNxB6P49Ihhtef0haXXR7OY7dd6HMGZAc1dSS3WzNL3dJqEmFMwyMI4DpaDDFu2U= X-Received: by 2002:a17:90b:d8a:b0:223:f336:1519 with SMTP id bg10-20020a17090b0d8a00b00223f3361519mr1542954pjb.198.1672105675904; Mon, 26 Dec 2022 17:47:55 -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> <688159e9-f6bc-f233-08c4-9834bc00c455@yandex.ru> In-Reply-To: <688159e9-f6bc-f233-08c4-9834bc00c455@yandex.ru> From: Aaron Jensen Date: Mon, 26 Dec 2022 20:47:44 -0500 Message-ID: Subject: Re: bug#60186: 29.0.60; ruby-mode indentation of multi-line expressions To: Dmitry Gutov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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:28 PM Dmitry Gutov wrote: > > On 25/12/2022 02:14, Aaron Jensen wrote: > > (setq ruby-indent-simplified t > > BTW, do you have any opinion on the name? Perhaps something more > semantic would be easier to discover. > > A recent tree-sitter thread brought up sh-indent-after-continuation. > It's not a direct counterpart, though, and the examples only look > remotely similar. > > Call ours ruby-indent-continuations-simplified, maybe? Now that we seem > to have reduced its scope to expression continuations across newlines. > > Hopefully it won't be confused with Kernel#callcc. Simple is what it is in comparison to something more complex. All indentations are pretty much about line continuation in one way or another. What is it on its own? I'm not sure. Some food for thought: Unaligned Beginning of line aligned Standard Incremental Snap-to-grid K&R style C style Egyptian brackets Not Lisp style Lisp alignment: false Argument alignment: false Sort of a smattering there, but maybe it'll jog something for you. Aaron From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 27 10:56:24 2022 Received: (at 60186) by debbugs.gnu.org; 27 Dec 2022 15:56:24 +0000 Received: from localhost ([127.0.0.1]:56353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pACJT-0005RM-UB for submit@debbugs.gnu.org; Tue, 27 Dec 2022 10:56:24 -0500 Received: from mail-wm1-f50.google.com ([209.85.128.50]:39794) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pACJR-0005RA-Pq for 60186@debbugs.gnu.org; Tue, 27 Dec 2022 10:56:22 -0500 Received: by mail-wm1-f50.google.com with SMTP id g25-20020a7bc4d9000000b003d97c8d4941so3920217wmk.4 for <60186@debbugs.gnu.org>; Tue, 27 Dec 2022 07:56:21 -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=duVKa8F3Za41fmT2WA3MW3IsZdCdRMTW04G7HvPr66o=; b=qiSNTe1TgWsQATFX7i3pAQqAhvm9MCbrvMLidltt5mFo+IyN3/DmkLh/Sd1IdnEfIo v3vl5q1nbVwTnqyYR6y3icQDney81KdRp+4V2FWgQl885Xjiy9XL//LEpMRcNOWW7kdM 6CYU/IA+ug5HRrNR6OLbiH8nelnkuALdRdadYgoMEIz+xgsXPMJ82yHYDvO7BJwf6Ji3 wfDOm+6ymAiOWAl+bU83vgSjy7PMhzHuDJK2sk2dMOMV61wrnVb4vSEubmlp4yrwILqQ p30IkC8NPTneOHn0G1jmAJlfAQZRYRVP5m8fXGOU1hVzU+xpw5IDXr5djtoj+JQv8qzb 18YA== 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=duVKa8F3Za41fmT2WA3MW3IsZdCdRMTW04G7HvPr66o=; b=ecnvmQXd/nAZ2inHpxOXa4Xp7cb+dv6yq5B2rcfi7wyepQ1fVQNoV4pCHntRueVKaD OgnWOqB85O9B/3R/RYi9ckSLpdx4aODL57Ta0nmHR0eid2RZjyX6sMPmDcfz4lC7ThQt gsY/9XkuQkSmoJuxebkUH/zy42J+vwMhN1yZ8TwFBL2ah+zq0NAJ3g/cYAu1uzjQOIyk N6g1r2gAktyzXBXXLFJqnX/6MWTv1IvgdBltViukviaoHDquni03ymOSY41YMy7DRL8d ngP4iQdFMtEnekhiiIGKUdYMXee2D6SvXQ55TKzl6sNPRTX5JA3tb90nxZJNbFJ0rMJA WFKA== X-Gm-Message-State: AFqh2krJU9YSgrip8jOkFiTOW8ukCxPs+XpuQOdq5b7kh84wqM6ltFDC 6FnFXjvseIC4a4H6Ku90Y3E= X-Google-Smtp-Source: AMrXdXvMC3a/89/3zK+ehKRylbXrU0N8ZUofJs32TgLb3z1tF9CH9w1XsOy1q0meGS28BQ0uqHAd/Q== X-Received: by 2002:a05:600c:250:b0:3d2:2830:b8bb with SMTP id 16-20020a05600c025000b003d22830b8bbmr18513678wmj.34.1672156575943; Tue, 27 Dec 2022 07:56:15 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id l6-20020a05600c4f0600b003d9780466b0sm10631668wmq.31.2022.12.27.07.56.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Dec 2022 07:56:15 -0800 (PST) Message-ID: <74f977f6-d9ba-04bd-fba0-0dce4729cf0d@yandex.ru> Date: Tue, 27 Dec 2022 17:56:14 +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#60186: 29.0.60; ruby-mode indentation of multi-line expressions 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> <688159e9-f6bc-f233-08c4-9834bc00c455@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: 60186 Cc: 60186@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 27/12/2022 03:47, Aaron Jensen wrote: > On Mon, Dec 26, 2022 at 8:28 PM Dmitry Gutov wrote: >> >> On 25/12/2022 02:14, Aaron Jensen wrote: >>> (setq ruby-indent-simplified t >> >> BTW, do you have any opinion on the name? Perhaps something more >> semantic would be easier to discover. >> >> A recent tree-sitter thread brought up sh-indent-after-continuation. >> It's not a direct counterpart, though, and the examples only look >> remotely similar. >> >> Call ours ruby-indent-continuations-simplified, maybe? Now that we seem >> to have reduced its scope to expression continuations across newlines. >> >> Hopefully it won't be confused with Kernel#callcc. > > 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. > 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. > What is it on its own? I'm not sure. > > Some food for thought: > > Unaligned That might be a good adjective (if we take it to mean, not aligned to the closest parent AST node), but something else to narrow down the scope is needed in the name. ruby-operator-unaligned-indent? ruby-operator-shallow-indent? > Beginning of line aligned Beginning of statement, I guess? > Standard "Standard" is a point of view. ;-) From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 27 11:34:46 2022 Received: (at 60186) by debbugs.gnu.org; 27 Dec 2022 16:34:46 +0000 Received: from localhost ([127.0.0.1]:56377 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pACub-0006Ow-TS for submit@debbugs.gnu.org; Tue, 27 Dec 2022 11:34:46 -0500 Received: from mail-pf1-f171.google.com ([209.85.210.171]:41496) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pACuZ-0006Oi-Vb for 60186@debbugs.gnu.org; Tue, 27 Dec 2022 11:34:44 -0500 Received: by mail-pf1-f171.google.com with SMTP id k137so4377499pfd.8 for <60186@debbugs.gnu.org>; Tue, 27 Dec 2022 08:34:43 -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=DFNRAWEg4PjUuXptyUpA9UsGELdwFy77BmPm/lkyE70=; b=f4xOdv/qsnRToqKXWFZn9Tm21OCfgZbdtnURnV5DAHocGLA3vwqHqCj7P7xybGiKoQ l/Say/8qQh9OGp+30CAZaqFqpyM2ICcK7rNt530aOk6X50CrEPRgfwDRH3Akv+b7MncP 3o8uFNJoLQPlNF6GX0l3rKSPB8JIv0aM1uiF7K8d6uDyBjSzoZNzmbb0dNXjISbZRS8g qCPr7hlV9djNeNbIw0Q3oiicDla52Sya+sfx7oLIT1wcpVITaSzHeIwi1IVuXioK/s4m JhheZ0TtmIMfQBkkcCm2lxdGlyArklYA8s90l4/GZOfLdLQZlFImWO5btJGY+qdvJXde cw4Q== 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=DFNRAWEg4PjUuXptyUpA9UsGELdwFy77BmPm/lkyE70=; b=dPmoZ2iTpgzsBs7RwvQD/ICnyKQ6hXr/79F3N6ikFg3w92lio7VFvO2LCN/R5oaMqD 9IOFrL69FWqT00TlZb1gdnv7ZCT8j8GznL0rxRLcCUNzxwBGYbEcOQxF7gGRg8AMkJNk adGkWeH84LpiOH/ndaVqR3Pnx8SgVyPm211rm/m9C9X59PgAoM3ZL9gpdcvSt8vECF6d Fy88Ksd7OdSwB+2hu6e1l/xS4A3VjshUlmJZ5wNutDLH5u5ktWFlkFNudXoVPTcLIGnC cdIeYh7cyY4SbYdI53cxZDtxa4qXcSXwlt1XSr0foF9IsJ93DbggNuGkQwX8hgg1jJqc IbPA== X-Gm-Message-State: AFqh2kogvYfHB77sFNfiHm1VaMHs++2TrmGmdHntqaGZ3XbAIZtak9ci L9KbKZvwtOJy1PP1fMifC9CPru+jiHCFLgvwC0M= X-Google-Smtp-Source: AMrXdXvjD7HBki63nTVuBDWej/teBKpv/9ly+vcdFad3+tuGoKeVNCWz3xc+gkEzRFhurm1JMj7tVsdn+4Q6u9YUXZM= X-Received: by 2002:aa7:8653:0:b0:578:5df5:9abe with SMTP id a19-20020aa78653000000b005785df59abemr1437291pfo.33.1672158877948; Tue, 27 Dec 2022 08:34:37 -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> <688159e9-f6bc-f233-08c4-9834bc00c455@yandex.ru> <74f977f6-d9ba-04bd-fba0-0dce4729cf0d@yandex.ru> In-Reply-To: <74f977f6-d9ba-04bd-fba0-0dce4729cf0d@yandex.ru> From: Aaron Jensen Date: Tue, 27 Dec 2022 11:34:26 -0500 Message-ID: Subject: Re: bug#60186: 29.0.60; ruby-mode indentation of multi-line expressions To: Dmitry Gutov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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 Tue, Dec 27, 2022 at 10:56 AM Dmitry Gutov wrote: > > On 27/12/2022 03:47, Aaron Jensen wrote: > > On Mon, Dec 26, 2022 at 8:28 PM Dmitry Gutov wrote: > >> > >> On 25/12/2022 02:14, Aaron Jensen wrote: > >>> (setq ruby-indent-simplified t > >> > >> BTW, do you have any opinion on the name? Perhaps something more > >> semantic would be easier to discover. > >> > >> A recent tree-sitter thread brought up sh-indent-after-continuation. > >> It's not a direct counterpart, though, and the examples only look > >> remotely similar. > >> > >> Call ours ruby-indent-continuations-simplified, maybe? Now that we seem > >> to have reduced its scope to expression continuations across newlines. > >> > >> Hopefully it won't be confused with Kernel#callcc. > > > > 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. > > 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. > > What is it on its own? I'm not sure. > > > > Some food for thought: > > > > Unaligned > > That might be a good adjective (if we take it to mean, not aligned to > the closest parent AST node), but something else to narrow down the > scope is needed in the name. ruby-operator-unaligned-indent? > > ruby-operator-shallow-indent? > > > Beginning of line aligned > > Beginning of statement, I guess? Yeah, that would be better than line > > Standard > > "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. 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. 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. Aaron From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 27 18:04:55 2022 Received: (at 60186) by debbugs.gnu.org; 27 Dec 2022 23:04:55 +0000 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 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 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) 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) Message-ID: <8d554fc2-7da5-cfe1-c865-023d56d222e3@yandex.ru> Date: Wed, 28 Dec 2022 01:04:45 +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#60186: 29.0.60; ruby-mode indentation of multi-line expressions 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> <688159e9-f6bc-f233-08c4-9834bc00c455@yandex.ru> <74f977f6-d9ba-04bd-fba0-0dce4729cf0d@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: 60186 Cc: 60186@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 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. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 27 19:38:33 2022 Received: (at 60186) by debbugs.gnu.org; 28 Dec 2022 00:38:33 +0000 Received: from localhost ([127.0.0.1]:56788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAKSn-0004NQ-7z for submit@debbugs.gnu.org; Tue, 27 Dec 2022 19:38:33 -0500 Received: from mail-pg1-f175.google.com ([209.85.215.175]:46015) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAKSl-0004N6-Dq for 60186@debbugs.gnu.org; Tue, 27 Dec 2022 19:38:32 -0500 Received: by mail-pg1-f175.google.com with SMTP id r18so9673022pgr.12 for <60186@debbugs.gnu.org>; Tue, 27 Dec 2022 16:38:31 -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=NP7gxj4mFDsK/F3OCAptdWLri+Igz1WqBepbta/tPOM=; b=a+Cs888pHpuBPyXshXRM/lM1Pp/pfTHjB73jdSfpc9iywwy6Q3H7sidCkpidPgW9ox 89+QMv/KtvVm8GNPEMuYLvlxhSUnIQ+q1+Q2o/E72RsK0nEeNePQmxI06CAQqpUINO2q 65SD7evVdC1JWa8Y13Yk7e/cDEtE5ai8jPnipd1e43V32GA9vOhGjAdwC35tYD6d1wbe L4ud1PU+otX+zhtV3U7lbkGoabAZcp9pfjOtiZAHhI0J4qr7h82PCO58IyUe1M0GOmle mHsH6udiKWq0aht/evL5UFFl2MjgLQHo3swMgNnNoAR88guK8bxA9QfrPGshRgQzhgxz YdDg== 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=NP7gxj4mFDsK/F3OCAptdWLri+Igz1WqBepbta/tPOM=; b=YvBHIruI258XUUxFeku4AVs/vNK0OoMHxKTOTC5pHbjsn8ALGeaZMSIyRHSLeKUpRZ 9TVst+ranFEC9e631qOkapa8DuEbxyIbTIgJ7CHXX1ImcvkBTiqlzAWUfX1EgAC8Hk6v gHO8Rzbm3Fl2v36EsHbt0TStamNeJJJ7GTKlwTPfSXa+DrG+NK8IuBwGNZzOzylQb+wC /wj2+ecTj3bPAfWs+c1ha7A/P1TxxpVm+SZUQMl/zHFF4K0RcOKPpilcC7HGySeoY29j +/rW/SojVxpKvZbutkaOvTGI+9e1BHFwmZrJid0bl3lrJZAcnv3kTq8Vksc9FplUnzoY /GLw== X-Gm-Message-State: AFqh2kqSX54pWSEMkkqNi63lhKXS1ujbt8zV3plv1s6NhH0ebZJMxs5y iPlKYPXkea43fEq8w9rq0YQOV7SURj3zU5qECjw= X-Google-Smtp-Source: AMrXdXu/sTYXCnBeBMb8661iHEesP2NUrnN87opYIGRaB5fEh7bJBklGWRiSlEBaP2hzUW5WWKbzn86QMZt6rraygBM= X-Received: by 2002:a65:4c81:0:b0:486:f3bf:822e with SMTP id m1-20020a654c81000000b00486f3bf822emr1360848pgt.482.1672187905211; Tue, 27 Dec 2022 16:38:25 -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> <688159e9-f6bc-f233-08c4-9834bc00c455@yandex.ru> <74f977f6-d9ba-04bd-fba0-0dce4729cf0d@yandex.ru> <8d554fc2-7da5-cfe1-c865-023d56d222e3@yandex.ru> In-Reply-To: <8d554fc2-7da5-cfe1-c865-023d56d222e3@yandex.ru> From: Aaron Jensen Date: Tue, 27 Dec 2022 19:38:14 -0500 Message-ID: Subject: Re: bug#60186: 29.0.60; ruby-mode indentation of multi-line expressions To: Dmitry Gutov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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 Tue, Dec 27, 2022 at 6:04 PM Dmitry Gutov wrote: > > 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. 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? 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? Aaron From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 27 20:02:21 2022 Received: (at 60186) by debbugs.gnu.org; 28 Dec 2022 01:02:21 +0000 Received: from localhost ([127.0.0.1]:56815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAKpo-00059g-P2 for submit@debbugs.gnu.org; Tue, 27 Dec 2022 20:02:21 -0500 Received: from mail-wm1-f51.google.com ([209.85.128.51]:41633) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAKpn-00059P-7y for 60186@debbugs.gnu.org; Tue, 27 Dec 2022 20:02:20 -0500 Received: by mail-wm1-f51.google.com with SMTP id ay2-20020a05600c1e0200b003d22e3e796dso10442827wmb.0 for <60186@debbugs.gnu.org>; Tue, 27 Dec 2022 17:02: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=ivx+i7QyJ8AbFhSxD32GpdUo5ErYOl4d/Usk7ojbn50=; b=o8CwN2sVAg8sZwX6wRsCif8j29TvlFpnRo6dfvcnuPnBs1I0JYd+TaT42eiZG3sbmC cur0XB7sF2euGIgSkT3LvM8mOpdTS61i3+0hi4UUTOu5KmFsxvWROHYbP5OTdqpvw8Ge olQxF/I3vmdOmLwYNMXizDhDwplrNMVkCdqKDSBaCUet5xC5n4MM7dKyiKEDYLE7fSIg gsH98YJwkNv3h49GE57NxiOyqxNVMyFu+NPTlefJxFPjvw6F6NhiYwyN1cJeZUiqsUzg bRnerXvTVHhZmkYjzOIH9nOVPCA2USvI4tFdpiBqs/9klqb3rpTZiXIQgWqN4PgyFWKd zOFA== 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=ivx+i7QyJ8AbFhSxD32GpdUo5ErYOl4d/Usk7ojbn50=; b=CUKz0XdN6D8kuc/1byon26LDQFNPxdU4kIwof1WGjFgBrs/wk+eOWhsn7gBFuiE5Tz br9xmnCom2HF4LhbFEMCOUNF/iPrlH8bMiwukoWp4Ts48pmKjNVoqM7k38hQcn7PjMan 3wEwhjkRtiIjt7miaw/n1yNdt2JJGA5jR07rk02Pxy9e2piEoIVnLD0NB7JbjbxscZwX YMXepz6j6Q3Bx3fNvLaXQfJMMl2pW7VjQERx57CEWRoNVR42DgI0ma+G+O8hL+J5mSrT 6calWXlK80TYu245W32ETf2IXc0DNoMsEHiWtuWliZiCFhEbiOteo8Qg2UfWQ+ERzmzM bVZQ== X-Gm-Message-State: AFqh2kpQFSqo6q1AqTncwVYBDKyuvpPEItamTpksTQedZphY0BTR301N A5MqlbilYcyTuaIaWaVy6MQ= X-Google-Smtp-Source: AMrXdXsvfOdMriSKxlPXmCGoPpZpIiY2CSEavSDUI3s6U5aEE2kxPqsl+2gMLJZo57vnCChZRxcydw== X-Received: by 2002:a05:600c:3596:b0:3d2:3b8d:21e5 with SMTP id p22-20020a05600c359600b003d23b8d21e5mr16253294wmq.14.1672189333107; Tue, 27 Dec 2022 17:02:13 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id b22-20020a05600c4e1600b003c6d21a19a0sm19112427wmq.29.2022.12.27.17.02.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Dec 2022 17:02:12 -0800 (PST) Message-ID: <95adedfa-7644-c78b-8853-fde8ec38f621@yandex.ru> Date: Wed, 28 Dec 2022 03:02:11 +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#60186: 29.0.60; ruby-mode indentation of multi-line expressions Content-Language: en-US To: Aaron Jensen References: <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> <8d554fc2-7da5-cfe1-c865-023d56d222e3@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: 60186 Cc: 60186@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 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. > 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. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 27 22:47:43 2022 Received: (at 60186) by debbugs.gnu.org; 28 Dec 2022 03:47:43 +0000 Received: from localhost ([127.0.0.1]:56898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pANPq-000135-No for submit@debbugs.gnu.org; Tue, 27 Dec 2022 22:47:43 -0500 Received: from mail-pj1-f46.google.com ([209.85.216.46]:39515) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pANPo-00012A-M0 for 60186@debbugs.gnu.org; Tue, 27 Dec 2022 22:47:41 -0500 Received: by mail-pj1-f46.google.com with SMTP id o8-20020a17090a9f8800b00223de0364beso18934003pjp.4 for <60186@debbugs.gnu.org>; Tue, 27 Dec 2022 19:47:40 -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=sC2LD83kYEZ7Htq+2YlzArcxuobK2KBqTRgKw8NWn5s=; b=HTr+YU5gzV81HMR/5hECdPPtHZs+2z6gZKtnLvvE0t0ZQQBqUpOwURERs2gihTJMYE 9dKxJ1sc/QZwD22CqT61bNrmJlaVC/km1YBFqhNVyvfmNd4mzpQcl/scE2uFCXTHZX+6 FZslZW6lrUVzC6D3xGTgNEpzPhR3Gra7cj/KzXMsHoy72ipgc6E19oQr2Z2R2nwUWVSF 3SyuZi+JYzy2LjPWizKfPNxOezLQbvQut9/gMza2W0/D++qNg6lpZxhbykRHA2JwkHS0 +MFTKPBB7DwJos7jOhj8v8UvTBdIU8s3kUA8/WIarFOaZLvgS4jI3hbQyp3DCXqc6aDp BuQQ== 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=sC2LD83kYEZ7Htq+2YlzArcxuobK2KBqTRgKw8NWn5s=; b=UarNeLpJzzaZWd8Cn0Cc+Okxa6qhKyxY0nQzaspcaxRPR9zehDdegw/G3SHNx+qCUz o7c7UL/kaa2nLyExJ2jJZuZsdb+83/mcguDbPGNa7fsCpxZZJiacNL9hnp3MwwrVYsBx S/H4r2o+7MXrW86y0mfEbYFo8ixwVVwMlBBMk6OiDU4YUVnergCKTagX/WDPG6DoXnxx 1ikhPO1XE0F/lM47/uk1dXHBhvdtwZiqG1K8kZaZsuw2hZ2gwC5SBRHrj8LN5GMUNUqf wpc7bpkWeynByfe1LsgctJjHsHZ1NSLyWzmcb+xaAIkkG/f+C8BAjAWzd13jZSN5UEoJ VRQg== X-Gm-Message-State: AFqh2krBxBPAPrdYGUhCQxAfu1zirXifxShCqDjzKTcXf9KvbrzM9QuU QV9XDMPOdtqqUL0JVntKdPKMgVzonPhFN+wtaQM= X-Google-Smtp-Source: AMrXdXuBc71a1vFcNadHDZZV2VXBcMYnkh8wng2vaJ1KQIHKkwmbYsJZwwQhbU2BTm/UjffFFpZhYJmblcciyQrKBDM= X-Received: by 2002:a17:902:7d92:b0:18e:bd50:f19a with SMTP id a18-20020a1709027d9200b0018ebd50f19amr1290787plm.81.1672199254478; Tue, 27 Dec 2022 19:47:34 -0800 (PST) MIME-Version: 1.0 References: <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> <8d554fc2-7da5-cfe1-c865-023d56d222e3@yandex.ru> <95adedfa-7644-c78b-8853-fde8ec38f621@yandex.ru> In-Reply-To: <95adedfa-7644-c78b-8853-fde8ec38f621@yandex.ru> From: Aaron Jensen Date: Tue, 27 Dec 2022 22:47:23 -0500 Message-ID: Subject: Re: bug#60186: 29.0.60; ruby-mode indentation of multi-line expressions To: Dmitry Gutov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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 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. > > 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. Aaron From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 28 07:47:22 2022 Received: (at 60186) by debbugs.gnu.org; 28 Dec 2022 12:47:22 +0000 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 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 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) 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) Message-ID: <44ccf2d5-789f-f122-34f9-25871fdf1283@yandex.ru> Date: Wed, 28 Dec 2022 14:47:12 +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#60186: 29.0.60; ruby-mode indentation of multi-line expressions Content-Language: en-US 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> <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> 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: 60186 Cc: 60186@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 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/. From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 28 16:24:18 2022 Received: (at 60186) by debbugs.gnu.org; 28 Dec 2022 21:24:18 +0000 Received: from localhost ([127.0.0.1]:58816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAduL-0006aC-Lx for submit@debbugs.gnu.org; Wed, 28 Dec 2022 16:24:18 -0500 Received: from mail-ej1-f54.google.com ([209.85.218.54]:42827) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAduI-0006Zw-6S for 60186@debbugs.gnu.org; Wed, 28 Dec 2022 16:24:15 -0500 Received: by mail-ej1-f54.google.com with SMTP id tz12so40947290ejc.9 for <60186@debbugs.gnu.org>; Wed, 28 Dec 2022 13:24:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:references:cc:to:from:content-language:subject :user-agent:mime-version:date:message-id:sender:from:to:cc:subject :date:message-id:reply-to; bh=BVmWm87v/4uBp2GSt8kaiAtc7RBmpV7JtGQ20QxDVGk=; b=IRHF5GDAjwLY/CMVdFLJfYRKrv4nnazhe/znQAEuPyk5ETymhodNgW6gZoRAUw6M/o pTL0XA9+SHpmbqclSVCDJ0a1RtFUp9wItCXCpo3KJ2SMtyeoAdBjJsyRhhZBPKjDVYtC mm721m+bFi4cGdjYZbIKugIZ94O2ylPnxcdE72/Tb85GQFCgEJ1L2S7iqOGwR7Ku5Sb+ rJE9vRoHKIf0DNbyDJlaqqfwrnes4QI0ilNYTr5dJtYBkWJeWbKJZEFYSMKRPSdKeT6o 6JLTKXNazSBMECY4Z1SXVlZUu7beSLY521i8dC9Rt3kykA1o7NQZm34nIj+D0sDngdeD Hf6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:references:cc:to:from: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=BVmWm87v/4uBp2GSt8kaiAtc7RBmpV7JtGQ20QxDVGk=; b=EQhm2CPL7LP1fW/YNOc2sLgAE8U2cqrfJ6nEwfw98vlXr5T/zA6vGXvrMp0IS0Bitm RA0ogDz5jXPPHdBCtzqE7PwXZ+/v6GLid7WZX2NvH12Pqy9feTD55TqHzirHOJ6oXAf3 /9jLPt68U6AchEPR+FEapc0V9cuE+5NGO1lxSPaCbF5m5/zwv4yxx2JgXveVQQSQkZ07 cVVsKnPmoM2Jzu7lQ6oS/1iYtt0hjNwJP5K40Wb4EUkJP+wYNT67BNDDpK7StCsnwpYA TQX516RSm/7XTHDQxmkto3TWrIZcTrXc3g/5wSBWDnvkV9ZJpP1wM7nSL5bheQAJj0Lj UvHg== X-Gm-Message-State: AFqh2koU7mA76Mu9fz/Ob218zGuWLz6uW3Eosvt4EFkRGcyHvpLGPmbG yG/3rUd+TTmG/vxDUfSSBtQ= X-Google-Smtp-Source: AMrXdXu6MnOMveQxLHFEO6WLW/4TYadgrywQJChw0uIkwkBygE2u1gnCTVLxgcUk0q2TcUwgkNH4Xw== X-Received: by 2002:a17:907:cbc7:b0:846:ccf3:d901 with SMTP id vk7-20020a170907cbc700b00846ccf3d901mr25556117ejc.52.1672262648249; Wed, 28 Dec 2022 13:24:08 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id ky14-20020a170907778e00b007c4f8bc322asm7771705ejc.196.2022.12.28.13.24.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Dec 2022 13:24:07 -0800 (PST) Content-Type: multipart/mixed; boundary="------------N8VyiyMKWpRHeE3EBtUfggWL" Message-ID: <118143a7-0703-2538-9853-7009064e7bca@yandex.ru> Date: Wed, 28 Dec 2022 23:24:06 +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#60186: 29.0.60; ruby-mode indentation of multi-line expressions Content-Language: en-US From: Dmitry Gutov To: Aaron Jensen References: <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> <44ccf2d5-789f-f122-34f9-25871fdf1283@yandex.ru> In-Reply-To: <44ccf2d5-789f-f122-34f9-25871fdf1283@yandex.ru> X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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 (-) This is a multi-part message in MIME format. --------------N8VyiyMKWpRHeE3EBtUfggWL Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 28/12/2022 14:47, Dmitry Gutov wrote: > 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. Semantics aside (I suppose we could go back and revise the naming a little later), could you test this new revision of the patch? I think I got the implementation simple enough now. The number of options has grown, though: (setq ruby-after-operator-indent nil ruby-block-indent nil ruby-method-call-indent nil ruby-parenless-call-arguments-indent nil) --------------N8VyiyMKWpRHeE3EBtUfggWL Content-Type: text/x-patch; charset=UTF-8; name="ruby-simplified-indent-v6.diff" Content-Disposition: attachment; filename="ruby-simplified-indent-v6.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVzL3J1YnktbW9kZS5lbCBiL2xpc3AvcHJvZ21v ZGVzL3J1YnktbW9kZS5lbAppbmRleCBhNGFhNjE5MDVlNC4uMDIxZGRhMWEzZTEgMTAwNjQ0 Ci0tLSBhL2xpc3AvcHJvZ21vZGVzL3J1YnktbW9kZS5lbAorKysgYi9saXNwL3Byb2dtb2Rl cy9ydWJ5LW1vZGUuZWwKQEAgLTI4NSw2ICsyOD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4ID0gNCArIDUg KgorICAgICAgICAgICAgNiArCisgICAgICAgIDcKKworU2V0IGl0IHRvIG5pbCB0byBhbGln biB0byB0aGUgYmVnaW5uaW5nIG9mIHRoZSBzdGF0ZW1lbnQ6CisKKyAgcXV4ID0gNCArIDUg KgorICAgIDYgKworICAgIDcKKworT25seSBoYXMgZWZmZWN0IHdoZW4gYHJ1YnktdXNlLXNt aWUnIGlzIHQuIgorICA6dHlwZSAnYm9vbGVhbgorICA6c2FmZSAnYm9vbGVhbnApCisKKyhk ZWZjdXN0b20gcnVieS1tZXRob2QtY2FsbC1pbmRlbnQgdAorICAiTm9uLW5pbCB0byB1c2Ug dGhlIHN0cnVjdHVyYWwgaW5kZW50YXRpb24gYWxnb3JpdGhtLgorCitUaGUgbWV0aG9kIGNh bGwgd2lsbCBiZSBhbGlnbmVkIHRvIHRoZSBpbXBsaWNpdCBwYXJlbnQKK2V4cHJlc3Npb24s IGFjY29yZGluZyB0byB0aGUgb3BlcmF0b3IgcHJlY2VkZW5jZToKKworICBmb28gPSBzdWJq ZWN0CisgICAgICAgICAgLnVwZGF0ZSgKKyAgICAgICAgICAgIDEKKyAgICAgICAgICApCisK K1NldCBpdCB0byBuaWwgdG8gYWxpZ24gdG8gdGhlIGJlZ2lubmluZyBvZiB0aGUgc3RhdGVt ZW50OgorCisgIGZvbyA9IHN1YmplY3QKKyAgICAudXBkYXRlKAorICAgICAgMQorICAgICkK KworT25seSBoYXMgZWZmZWN0IHdoZW4gYHJ1YnktdXNlLXNtaWUnIGlzIHQuIgorICA6dHlw ZSAnYm9vbGVhbgorICA6c2FmZSAnYm9vbGVhbnApCisKKyhkZWZjdXN0b20gcnVieS1wYXJl bmxlc3MtY2FsbC1hcmd1bWVudHMtaW5kZW50IHQKKyAgIk5vbi1uaWwgdG8gYWxpZ24gYXJn dW1lbnRzIGluIGEgcGFyZW5sZXNzIGNhbGwgdmVydGljYWxseS4KKworRXhhbXBsZToKKwor ICBxdXggOissCisgICAgICBiYXIsCisgICAgICA6W109LAorICAgICAgYmFyCisKK1NldCBp dCB0byBuaWwgdG8gYWxpZ24gdG8gdGhlIGJlZ2lubmluZyBvZiB0aGUgc3RhdGVtZW50Ogor CisgIHF1eCA6KywKKyAgICBiYXIsCisgICAgOltdPSwKKyAgICBiYXIKKworT25seSBoYXMg ZWZmZWN0IHdoZW4gYHJ1YnktdXNlLXNtaWUnIGlzIHQuIgorICA6dHlwZSAnYm9vbGVhbgor ICA6c2FmZSAnYm9vbGVhbnApCisKIChkZWZjdXN0b20gcnVieS1kZWVwLWFyZ2xpc3QgdAog ICAiRGVlcCBpbmRlbnQgbGlzdHMgaW4gcGFyZW50aGVzaXMgd2hlbiBub24tbmlsLgogQWxz byBpZ25vcmVzIHNwYWNlcyBhZnRlciBwYXJlbnRoZXNpcyB3aGVuIGBzcGFjZScuCkBAIC00 MTYsNiArNTAyLDcgQEAgcnVieS1zbWllLWdyYW1tYXIKICAgICAgJygocmlnaHQgIj0iKQog ICAgICAgIChyaWdodCAiKz0iICItPSIgIio9IiAiLz0iICIlPSIgIioqPSIgIiY9IiAifD0i ICJePSIKICAgICAgICAgICAgICAgIjw8PSIgIj4+PSIgIiYmPSIgInx8PSIpCisgICAgICAg KHJpZ2h0ICI/IikKICAgICAgICAobm9uYXNzb2MgIi4uIiAiLi4uIikKICAgICAgICAobGVm dCAiJiYiICJ8fCIpCiAgICAgICAgKG5vbmFzc29jICI8PT4iKQpAQCAtNjA4LDEwICs2OTUs MTAgQEAgcnVieS1zbWllLS1iYWNrd2FyZC10b2tlbgogICAgICAgICAgICJkZWY9IikKICAg ICAgICAgICh0IHRvaykpKSkpKSkKIAotKGRlZnVuIHJ1Ynktc21pZS0taW5kZW50LXRvLXN0 bXQgKCkKKyhkZWZ1biBydWJ5LXNtaWUtLWluZGVudC10by1zdG10ICgmb3B0aW9uYWwgb2Zm c2V0KQogICAoc2F2ZS1leGN1cnNpb24KICAgICAoc21pZS1iYWNrd2FyZC1zZXhwICI7IikK LSAgICAoY29ucyAnY29sdW1uIChzbWllLWluZGVudC12aXJ0dWFsKSkpKQorICAgIChjb25z ICdjb2x1bW4gKCsgKHNtaWUtaW5kZW50LXZpcnR1YWwpIChvciBvZmZzZXQgMCkpKSkpCiAK IChkZWZ1biBydWJ5LXNtaWUtLWluZGVudC10by1zdG10LXAgKGtleXdvcmQpCiAgIChvciAo ZXEgdCBydWJ5LWFsaWduLXRvLXN0bXQta2V5d29yZHMpCkBAIC02NDIsNyArNzI5LDkgQEAg cnVieS1zbWllLXJ1bGVzCiAgICAgICAgICAgICAgIChmb3J3YXJkLWNvbW1lbnQgLTEpCiAg ICAgICAgICAgICAgIChub3QgKGVxIChwcmVjZWRpbmctY2hhcikgPzopKSkpCiAgICAgICAg OzsgQ3VybHkgYmxvY2sgb3BlbmVyLgotICAgICAgIChydWJ5LXNtaWUtLWluZGVudC10by1z dG10KSkKKyAgICAgICAoaWYgcnVieS1ibG9jay1pbmRlbnQKKyAgICAgICAgICAgKHJ1Ynkt c21pZS0taW5kZW50LXRvLXN0bXQpCisgICAgICAgICAoY29ucyAnY29sdW1uIChjdXJyZW50 LWluZGVudGF0aW9uKSkpKQogICAgICAgKChzbWllLXJ1bGUtaGFuZ2luZy1wKQogICAgICAg IDs7IFRyZWF0IHB1cmVseSBzeW50YWN0aWMgYmxvY2stY29uc3RydWN0cyBhcyBiZWluZyBw YXJ0IG9mIHRoZWlyIHBhcmVudCwKICAgICAgICA7OyB3aGVuIHRoZSBvcGVuaW5nIHRva2Vu IGlzIGhhbmdpbmcgYW5kIHRoZSBwYXJlbnQgaXMgbm90IGFuCkBAIC02NzcsMTMgKzc2Niwy MCBAQCBydWJ5LXNtaWUtcnVsZXMKICAgICAgICAodW5sZXNzIChvciAoZW9scCkgKGZvcndh cmQtY29tbWVudCAxKSkKICAgICAgICAgIChjb25zICdjb2x1bW4gKGN1cnJlbnQtY29sdW1u KSkpKSkKICAgICAoJyg6YmVmb3JlIC4gIiBAICIpCi0gICAgIChpZiAob3IgKGVxIHJ1Ynkt bWV0aG9kLXBhcmFtcy1pbmRlbnQgdCkKLSAgICAgICAgICAgICAobm90IChzbWllLXJ1bGUt cGFyZW50LXAgImRlZiIgImRlZj0iKSkpCi0gICAgICAgICAoc2F2ZS1leGN1cnNpb24KLSAg ICAgICAgICAgKHNraXAtY2hhcnMtZm9yd2FyZCAiIFx0IikKLSAgICAgICAgICAgKGNvbnMg J2NvbHVtbiAoY3VycmVudC1jb2x1bW4pKSkKLSAgICAgICAoc21pZS1ydWxlLXBhcmVudCAo b3IgcnVieS1tZXRob2QtcGFyYW1zLWluZGVudCAwKSkpKQotICAgICgnKDpiZWZvcmUgLiAi ZG8iKSAocnVieS1zbWllLS1pbmRlbnQtdG8tc3RtdCkpCisgICAgIChjb25kCisgICAgICAo KGFuZCAobm90IHJ1YnktcGFyZW5sZXNzLWNhbGwtYXJndW1lbnRzLWluZGVudCkKKyAgICAg ICAgICAgIChub3QgKHNtaWUtcnVsZS1wYXJlbnQtcCAiZGVmIiAiZGVmPSIpKSkKKyAgICAg ICAocnVieS1zbWllLS1pbmRlbnQtdG8tc3RtdCBydWJ5LWluZGVudC1sZXZlbCkpCisgICAg ICAoKG9yIChlcSBydWJ5LW1ldGhvZC1wYXJhbXMtaW5kZW50IHQpCisgICAgICAgICAgIChu b3QgKHNtaWUtcnVsZS1wYXJlbnQtcCAiZGVmIiAiZGVmPSIpKSkKKyAgICAgICAoc2F2ZS1l eGN1cnNpb24KKyAgICAgICAgIChza2lwLWNoYXJzLWZvcndhcmQgIiBcdCIpCisgICAgICAg ICAoY29ucyAnY29sdW1uIChjdXJyZW50LWNvbHVtbikpKSkKKyAgICAgICh0IChzbWllLXJ1 bGUtcGFyZW50IChvciBydWJ5LW1ldGhvZC1wYXJhbXMtaW5kZW50IDApKSkpKQorICAgICgn KDpiZWZvcmUgLiAiZG8iKQorICAgICAoaWYgcnVieS1ibG9jay1pbmRlbnQKKyAgICAgICAg IChydWJ5LXNtaWUtLWluZGVudC10by1zdG10KQorICAgICAgIChjb25zICdjb2x1bW4gKGN1 cnJlbnQtaW5kZW50YXRpb24pKSkpCiAgICAgKCcoOmJlZm9yZSAuICIuIikKICAgICAgKGlm IChzbWllLXJ1bGUtc2libGluZy1wKQogICAgICAgICAgKHdoZW4gcnVieS1hbGlnbi1jaGFp bmVkLWNhbGxzCkBAIC02OTYsOCArNzkyLDEwIEBAIHJ1Ynktc21pZS1ydWxlcwogICAgICAg ICAgICAgICAgICAgIChub3QgKHNtaWUtcnVsZS1ib2xwKSkpKSkKICAgICAgICAgICAgKGNv bnMgJ2NvbHVtbiAoY3VycmVudC1jb2x1bW4pKSkKICAgICAgICAoc21pZS1iYWNrd2FyZC1z ZXhwICIuIikKLSAgICAgICAoY29ucyAnY29sdW1uICgrIChjdXJyZW50LWNvbHVtbikKLSAg ICAgICAgICAgICAgICAgICAgICAgIHJ1YnktaW5kZW50LWxldmVsKSkpKQorICAgICAgIChp ZiBydWJ5LW1ldGhvZC1jYWxsLWluZGVudAorICAgICAgICAgICAoY29ucyAnY29sdW1uICgr IChjdXJyZW50LWNvbHVtbikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWJ5LWlu ZGVudC1sZXZlbCkpCisgICAgICAgICAocnVieS1zbWllLS1pbmRlbnQtdG8tc3RtdCBydWJ5 LWluZGVudC1sZXZlbCkpKSkKICAgICAoYCg6YmVmb3JlIC4gLChvciAiZWxzZSIgInRoZW4i ICJlbHNpZiIgInJlc2N1ZSIgImVuc3VyZSIpKQogICAgICAoc21pZS1ydWxlLXBhcmVudCkp CiAgICAgKGAoOmJlZm9yZSAuICwob3IgIndoZW4iICJpbiIpKQpAQCAtNzA4LDE2ICs4MDYs MjIgQEAgcnVieS1zbWllLXJ1bGVzCiAgICAgICAgICAgICAgICAgICAgICAiPD0+IiAiPiIg IjwiICI+PSIgIjw9IiAiPT0iICI9PT0iICIhPSIgIjw8IiAiPj4iCiAgICAgICAgICAgICAg ICAgICAgICAiKz0iICItPSIgIio9IiAiLz0iICIlPSIgIioqPSIgIiY9IiAifD0iICJePSIg InwiCiAgICAgICAgICAgICAgICAgICAgICAiPDw9IiAiPj49IiAiJiY9IiAifHw9IiAiYW5k IiAib3IiKSkKLSAgICAgKGFuZCAoc21pZS1ydWxlLXBhcmVudC1wICI7IiBuaWwpCi0gICAg ICAgICAgKHNtaWUtaW5kZW50LS1oYW5naW5nLXApCi0gICAgICAgICAgcnVieS1pbmRlbnQt bGV2ZWwpKQorICAgICAoY29uZAorICAgICAgKChub3QgcnVieS1hZnRlci1vcGVyYXRvci1p bmRlbnQpCisgICAgICAgKHJ1Ynktc21pZS0taW5kZW50LXRvLXN0bXQgcnVieS1pbmRlbnQt bGV2ZWwpKQorICAgICAgKChhbmQgKHNtaWUtcnVsZS1wYXJlbnQtcCAiOyIgbmlsKQorICAg ICAgICAgICAgKHNtaWUtaW5kZW50LS1oYW5naW5nLXApKQorICAgICAgIHJ1YnktaW5kZW50 LWxldmVsKSkpCiAgICAgKGAoOmJlZm9yZSAuICI9IikKICAgICAgKHNhdmUtZXhjdXJzaW9u CiAgICAgICAoYW5kIChzbWllLXJ1bGUtcGFyZW50LXAgIiBAICIpCiAgICAgICAgICAgIChn b3RvLWNoYXIgKG50aCAxIChzbWllLWluZGVudC0tcGFyZW50KSkpCiAgICAgICAgICAgIChz bWllLXJ1bGUtcHJldi1wICJkZWY9IikKICAgICAgICAgICAgKGNvbnMgJ2NvbHVtbiAoKyAo Y3VycmVudC1jb2x1bW4pIHJ1YnktaW5kZW50LWxldmVsIC0zKSkpKSkKLSAgICAoYCg6YWZ0 ZXIgLiAsKG9yICI/IiAiOiIpKSBydWJ5LWluZGVudC1sZXZlbCkKKyAgICAoYCg6YWZ0ZXIg LiAsKG9yICI/IiAiOiIpKQorICAgICAoaWYgcnVieS1hZnRlci1vcGVyYXRvci1pbmRlbnQK KyAgICAgICAgIHJ1YnktaW5kZW50LWxldmVsCisgICAgICAgKHJ1Ynktc21pZS0taW5kZW50 LXRvLXN0bXQgcnVie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Zjc4MDI4NWEuLjVjODFj YzMxY2MxIDEwMDY0NAotLS0gYS90ZXN0L2xpc3AvcHJvZ21vZGVzL3J1YnktbW9kZS10ZXN0 cy5lbAorKysgYi90ZXN0L2xpc3AvcHJvZ21vZGVzL3J1YnktbW9kZS10ZXN0cy5lbApAQCAt OTU2LDcgKzk1NiwxMSBAQCBydWJ5LWRlZnRlc3QtaW5kZW50CiAgICAgICAgICAoa2lsbC1i dWZmZXIgYnVmKSkpKSkKIAogKHJ1YnktZGVmdGVzdC1pbmRlbnQgInJ1YnkucmIiKQorKHJ1 YnktZGVmdGVzdC1pbmRlbnQgInJ1YnktYWZ0ZXItb3BlcmF0b3ItaW5kZW50LnJiIikKKyhy dWJ5LWRlZnRlc3QtaW5kZW50ICJydWJ5LWJsb2NrLWluZGVudC5yYiIpCisocnVieS1kZWZ0 ZXN0LWluZGVudCAicnVieS1tZXRob2QtY2FsbC1pbmRlbnQucmIiKQogKHJ1YnktZGVmdGVz dC1pbmRlbnQgInJ1YnktbWV0aG9kLXBhcmFtcy1pbmRlbnQucmIiKQorKHJ1YnktZGVmdGVz dC1pbmRlbnQgInJ1YnktcGFyZW5sZXNzLWNhbGwtYXJndW1lbnRzLWluZGVudC5yYiIpCiAK IChlcnQtZGVmdGVzdCBydWJ5LS10ZXN0LWNoYWluZWQtaW5kZW50YXRpb24gKCkKICAgKHdp dGgtdGVtcC1idWZmZXIK --------------N8VyiyMKWpRHeE3EBtUfggWL-- From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 29 17:59:37 2022 Received: (at 60186) by debbugs.gnu.org; 29 Dec 2022 22:59:37 +0000 Received: from localhost ([127.0.0.1]:33143 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pB1s8-0007co-QU for submit@debbugs.gnu.org; Thu, 29 Dec 2022 17:59:37 -0500 Received: from mail-pl1-f179.google.com ([209.85.214.179]:36801) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pB1s7-0007cW-30 for 60186@debbugs.gnu.org; Thu, 29 Dec 2022 17:59:35 -0500 Received: by mail-pl1-f179.google.com with SMTP id 20so6815015plo.3 for <60186@debbugs.gnu.org>; Thu, 29 Dec 2022 14:59:35 -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=F1n+1N+xbaurl1fW2FbCK6GQaUw0sVWq3mWe6+gis3E=; b=D01IImg1ZfseewsyYkNLmjvoWl9TTBVv8NTf1dNF3ivYCmfSUNF/yNJ4iHmR8MleEa 2CCNPzD2zAyzWfAZWf+xhYb+x3pes+8a2zXIrFNohObvUviQuePAxjb8i5Xo4kbcQ7LJ KdeiVSg+7IL0Nkj75UHudPvBavf9mbFjCa9HK7gKexuEWrgIADKR0aFsdtOnNba3jRVA /E63q1GuvfHhOpKdpsbEw/jyaKSozyKHaRyQGgKKOEInqmN35JlHxva+VREjbdPh3B8M BzqlnQxN1tinHAvPf0TdwjGX0mPXXR5fPiGWNwDSyLUG7W3nsEXXsy97DsXRH1OB11V+ IAZQ== 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=F1n+1N+xbaurl1fW2FbCK6GQaUw0sVWq3mWe6+gis3E=; b=UAnZwO6p7OAfXj6puWMjR3gwN9b2cx7lV+G7Peig3//e06IwKQAVq0bY43zrMzx1+f gPEJZCY9y1ev6ICsK/LsN4S9UPgjTpYx5Hpa1+pCw5jJ8sNgz1a7lGiPp1IomO8m/b+3 JsVLAXm6PSQBc0PGg+8RPuwPRcoF98Xrt4RF6ChxViCAZdns+OPkRiCgvUdjz3TPC56s 4c99fptoSNr0dwjq50btIFGkSAvLmZvaWCcvJiY/aE6ft1igBFzk7q9dvZJerOOs+I48 Gh+/1twSj5AgM+TzRA90ZLx1YuAOqM8YfcWE/dN/NzBmvawKFVKmlUSnDn8/Thvy/gpl EE2g== X-Gm-Message-State: AFqh2kr6uinHFz92bp+YHEd2j8OHXCKllMEjs5AdyqqNiYl0xCvqZn5P GDAT0l42Yf1bTzBzo4DOlr19h7SY8x4Oud7/4rI= X-Google-Smtp-Source: AMrXdXshYhA3YWtQy9596b6fNyOIHFY5PE+CdvhRuVtsTvlXDRhQW66bpf0f8DJcwlSPz/h1iUcQgxXAQsLSLHIf4bY= X-Received: by 2002:a17:90a:ad8a:b0:212:e24e:16b3 with SMTP id s10-20020a17090aad8a00b00212e24e16b3mr2015199pjq.69.1672354769367; Thu, 29 Dec 2022 14:59:29 -0800 (PST) MIME-Version: 1.0 References: <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> <44ccf2d5-789f-f122-34f9-25871fdf1283@yandex.ru> <118143a7-0703-2538-9853-7009064e7bca@yandex.ru> In-Reply-To: <118143a7-0703-2538-9853-7009064e7bca@yandex.ru> From: Aaron Jensen Date: Thu, 29 Dec 2022 17:59:18 -0500 Message-ID: Subject: Re: bug#60186: 29.0.60; ruby-mode indentation of multi-line expressions To: Dmitry Gutov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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 Wed, Dec 28, 2022 at 4:24 PM Dmitry Gutov wrote: > > On 28/12/2022 14:47, Dmitry Gutov wrote: > > 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. > > Semantics aside (I suppose we could go back and revise the naming a > little later), could you test this new revision of the patch? > > I think I got the implementation simple enough now. > > The number of options has grown, though: > > (setq ruby-after-operator-indent nil > ruby-block-indent nil > ruby-method-call-indent nil > ruby-parenless-call-arguments-indent nil) I'll give it a shot some more, but these appear problematic: fixture( EntityProjection::Fixtures::Projection, projection, deleted ) do |projection| projection.assert_attributes_copied([ { :document_id => :id } ]) end Should be: fixture( EntityProjection::Fixtures::Projection, projection, deleted ) do |projection| projection.assert_attributes_copied([ { :document_id => :id } ]) end Aaron From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 30 10:02:36 2022 Received: (at 60186) by debbugs.gnu.org; 30 Dec 2022 15:02:36 +0000 Received: from localhost ([127.0.0.1]:35914 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBGu4-0007WQ-1v for submit@debbugs.gnu.org; Fri, 30 Dec 2022 10:02:36 -0500 Received: from mail-ed1-f44.google.com ([209.85.208.44]:38745) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBGu2-0007WE-AR for 60186@debbugs.gnu.org; Fri, 30 Dec 2022 10:02:34 -0500 Received: by mail-ed1-f44.google.com with SMTP id r26so25555770edc.5 for <60186@debbugs.gnu.org>; Fri, 30 Dec 2022 07:02:34 -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=FEFoCes2Uu9WbijYEQu0m0kNf9F4106JxBAmgiV0lNw=; b=UCsfc5wj0oD/7AblUBVoLF7cIka8qkFT4GhRAdLWUgCBr52bmzUQ/nefDXoqLT5kIw 3201/zqMnj6ev6YE/H5IOqeAyfCqCWaOYoVtXY5oSkbgC39yB9TpVUJXHCoGP8mUyIO5 iFjbrCJeqcndFSJ1UPFW9Ee7Al5JEPp5R0BFGuxxg1sjomWy39RZMY+zozDeVDPdwCZM /YyloMTQIa30nJ4ndp5HZuz8nluFvsDosAyvYs/ijNOVcGOWF0R19bnM36RfJPctnoed dKsisnwW+jjQkRM8sW2LE8VLxgMGadbyv5y0UCLQpzzR/nwZm9e4Yf2AHUGcPkEcDO1c h1sw== 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=FEFoCes2Uu9WbijYEQu0m0kNf9F4106JxBAmgiV0lNw=; b=0Ry07EVy6sH8KEEZoeWQWRNgtS1LdvSFAt9oMYbofMrF+a+v0TWylAOuJSwxIaZIDL rPA6Z5NC1YsDkYpPId1VZa1PviMEF6aWO1AFqOUsoiSsU8ungwcIf1yAOPAh7+7NueYj 3u7uIbnN9pQsQLNns9EzwP3irfZrosMoXyNa+pg0WiH2mSaxoSG36QanbGX8uqHeRAgx 9AVaALTz5enYoPZh1VYUO+SlrROXk6ROtr/ZZWLMQLH3pEEKJku6pH/UFM1GF2UFpXH9 24z+Qb3OpEtsEO8WEqjn27H9jdS89Z6fgbhlvmeXY3vYcIkqzMl9ssSwaADYP301Hn2z d9Ng== X-Gm-Message-State: AFqh2kpKfY38r4t5lAXi6N+UqeuIMD5/xM8dPefdXur+6tUrCi3dc1jn mYrB+OnFJSP/BU7qwcTgVxUaoIupYsI= X-Google-Smtp-Source: AMrXdXvf+z9VVeHtnOfWyK5b92XegvAMoOiwoGk44yoBc2jx7bLq7JSbKKLvVv58jarTqkqBAZTsgA== X-Received: by 2002:aa7:c30b:0:b0:46b:c11:c8d2 with SMTP id l11-20020aa7c30b000000b0046b0c11c8d2mr27717301edq.40.1672412548689; Fri, 30 Dec 2022 07:02:28 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id g24-20020a50ec18000000b0046b847d6a1csm9428181edr.21.2022.12.30.07.02.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 30 Dec 2022 07:02:28 -0800 (PST) Message-ID: <4540a3e6-f736-9050-0aac-0a9be1459248@yandex.ru> Date: Fri, 30 Dec 2022 17:02:26 +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#60186: 29.0.60; ruby-mode indentation of multi-line expressions Content-Language: en-US To: Aaron Jensen References: <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> <44ccf2d5-789f-f122-34f9-25871fdf1283@yandex.ru> <118143a7-0703-2538-9853-7009064e7bca@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: 60186 Cc: 60186@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 (-) Hi Aaron, On 30/12/2022 00:59, Aaron Jensen wrote: > On Wed, Dec 28, 2022 at 4:24 PM Dmitry Gutov wrote: >> On 28/12/2022 14:47, Dmitry Gutov wrote: >>> 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. >> Semantics aside (I suppose we could go back and revise the naming a >> little later), could you test this new revision of the patch? >> >> I think I got the implementation simple enough now. >> >> The number of options has grown, though: >> >> (setq ruby-after-operator-indent nil >> ruby-block-indent nil >> ruby-method-call-indent nil >> ruby-parenless-call-arguments-indent nil) > I'll give it a shot some more, but these appear problematic: > > fixture( > EntityProjection::Fixtures::Projection, > projection, > deleted > ) do|projection| > projection.assert_attributes_copied([ > { :document_id => :id } > ]) > end > > Should be: > > fixture( > EntityProjection::Fixtures::Projection, > projection, > deleted > ) do|projection| > projection.assert_attributes_copied([ > { :document_id => :id } > ]) > end This example is for https://debbugs.gnu.org/60321, I think. Which we split off and postponed a little. The last patch was the latest revision of the changes for https://debbugs.gnu.org/60186. As long as this example is unchanged (indented the same as the current version of ruby-mode), it's good enough. It looks like this on my machine, though: fixture( EntityProjection::Fixtures::Projection, projection, deleted ) do |projection| projection.assert_attributes_copied([ { :document_id => :id } ]) end Could you please give the v6 patch a good run soon-ish: we have a good chance of getting it into Emacs 29 (together with ruby-ts-mode, which should reuse some or most of the options), as I've just found out. The deadline for checking all this in is pretty near, alas: 1-2 days. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 30 13:00:28 2022 Received: (at 60186) by debbugs.gnu.org; 30 Dec 2022 18:00:28 +0000 Received: from localhost ([127.0.0.1]:36090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBJgB-0006Um-Vi for submit@debbugs.gnu.org; Fri, 30 Dec 2022 13:00:28 -0500 Received: from mail-pj1-f53.google.com ([209.85.216.53]:39684) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBJgA-0006Ua-BH for 60186@debbugs.gnu.org; Fri, 30 Dec 2022 13:00:26 -0500 Received: by mail-pj1-f53.google.com with SMTP id o8-20020a17090a9f8800b00223de0364beso26468810pjp.4 for <60186@debbugs.gnu.org>; Fri, 30 Dec 2022 10:00:26 -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=y9eUBH8wHITneUqW6/GOzAhjljyEiEA/5nOznh7mXyk=; b=OpBuCfmfklDr6/KXI0yEMX2O4pyllTCaI7/H4B+62w5hGooSrIxfPXGl1rkGwKIlxG 7hXu5+nP1EVTGNfXDM5yp7ULSok3/X24QJZRttOdbKwF6EJ6DCjoTYuVeikNFdStVHI6 lT4I0WLuj3F4T9agFIKOavwhvM6FJetCeKV18/x0ijkbNhtjzenwXBXUImGYcFn5KXGy NVTQAy+asVmPmZU6i/z8XJVwDng7MTb5Yq6R5aZW084MHAwvvSMkJIb+hRlH5l9Gd430 lq7GH6fDrG/pIpL95NYdgupnNXmO/X5nnDPNIklzTtjT6EiF6qU3cjCODzsgyX/Zmcdh AW3w== 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=y9eUBH8wHITneUqW6/GOzAhjljyEiEA/5nOznh7mXyk=; b=I7rTXvrH4ATUtNI+g8XegyvbD8XwvigHPBW+lSQJMssxmeKElYibh3qm5lfNDSmvlB 3LkrY5v9a6ZwUbkCOlbJEILHARoH7z08B33LwCDp4hJDu9TMCKSXZHjfADpvtnXQGu9T KaVVnfjIgw/iTrDmgzxXLcvIp/Mm2MEBCm8dhBSrlsPW4Z8Y6/dMJRbkAz0Oob/nz5X4 xvjnDbEQ3Bz3q3qF/juGW0xNRC5rauH1cl8QSdQi0P2T+91JJOGmLQ4gJTsWkgWMZZgL rnVoE9pk2twP609QfgqoWxnE95pd9Jc1LwZkdQ9ZzOxpUOMnuGS20PM6PhZoVchjHlzB vTAg== X-Gm-Message-State: AFqh2kr9jv4cbInZ12n5FQFv6sgHHZgTEUneJUa328PB36DX/gePuRoc AZYLLnjEB7P7yXzp1fCpoNpECDg4KsDsxMnL/7U= X-Google-Smtp-Source: AMrXdXt8DtbsXIRJg2KAGCxNpDVqcLxEyL5hrC2cjuYJtZnyBBo3xlGYRLS2VnjHMvniv8jc5ygDn7CoZqkQrOGMRpA= X-Received: by 2002:a17:90a:ad8a:b0:212:e24e:16b3 with SMTP id s10-20020a17090aad8a00b00212e24e16b3mr2162251pjq.69.1672423220437; Fri, 30 Dec 2022 10:00:20 -0800 (PST) MIME-Version: 1.0 References: <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> <44ccf2d5-789f-f122-34f9-25871fdf1283@yandex.ru> <118143a7-0703-2538-9853-7009064e7bca@yandex.ru> <4540a3e6-f736-9050-0aac-0a9be1459248@yandex.ru> In-Reply-To: <4540a3e6-f736-9050-0aac-0a9be1459248@yandex.ru> From: Aaron Jensen Date: Fri, 30 Dec 2022 13:00:09 -0500 Message-ID: Subject: Re: bug#60186: 29.0.60; ruby-mode indentation of multi-line expressions To: Dmitry Gutov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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 Fri, Dec 30, 2022 at 10:02 AM Dmitry Gutov wrote: > > Hi Aaron, > > On 30/12/2022 00:59, Aaron Jensen wrote: > > On Wed, Dec 28, 2022 at 4:24 PM Dmitry Gutov wrote: > >> On 28/12/2022 14:47, Dmitry Gutov wrote: > >>> 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. > >> Semantics aside (I suppose we could go back and revise the naming a > >> little later), could you test this new revision of the patch? > >> > >> I think I got the implementation simple enough now. > >> > >> The number of options has grown, though: > >> > >> (setq ruby-after-operator-indent nil > >> ruby-block-indent nil > >> ruby-method-call-indent nil > >> ruby-parenless-call-arguments-indent nil) > > I'll give it a shot some more, but these appear problematic: > > > > fixture( > > EntityProjection::Fixtures::Projection, > > projection, > > deleted > > ) do|projection| > > projection.assert_attributes_copied([ > > { :document_id => :id } > > ]) > > end > > > > Should be: > > > > fixture( > > EntityProjection::Fixtures::Projection, > > projection, > > deleted > > ) do|projection| > > projection.assert_attributes_copied([ > > { :document_id => :id } > > ]) > > end > > This example is for https://debbugs.gnu.org/60321, I think. Which we > split off and postponed a little. > > The last patch was the latest revision of the changes for > https://debbugs.gnu.org/60186. My mistake, it seems to work for these things aside from the method params in the example below. I can't reproduce that in emacs -Q, only with my own config, so I will have to see if I can figure out what the difference is. > As long as this example is unchanged (indented the same as the current > version of ruby-mode), it's good enough. It looks like this on my > machine, though: > > fixture( > EntityProjection::Fixtures::Projection, > projection, > deleted > ) do |projection| > projection.assert_attributes_copied([ > { :document_id => :id } > ]) > end > > Could you please give the v6 patch a good run soon-ish: we have a good > chance of getting it into Emacs 29 (together with ruby-ts-mode, which > should reuse some or most of the options), as I've just found out. > > The deadline for checking all this in is pretty near, alas: 1-2 days. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 30 13:16:54 2022 Received: (at 60186) by debbugs.gnu.org; 30 Dec 2022 18:16:54 +0000 Received: from localhost ([127.0.0.1]:36108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBJw5-0006u9-Qb for submit@debbugs.gnu.org; Fri, 30 Dec 2022 13:16:54 -0500 Received: from mail-pf1-f169.google.com ([209.85.210.169]:42840) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBJw4-0006ts-26 for 60186@debbugs.gnu.org; Fri, 30 Dec 2022 13:16:52 -0500 Received: by mail-pf1-f169.google.com with SMTP id a184so4129176pfa.9 for <60186@debbugs.gnu.org>; Fri, 30 Dec 2022 10:16:52 -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=yHCA/KTKwp7B7Kwu2uVf7j6pG80nczXvqIWwVgNqGkM=; b=VSM6+90wXzpmwFDUA2Dx65nGb6lvtNa8cCBiw9qCkJjXgXG+eJYFi5YBWE0CRV800M 1TXG+SYs3CS2WviPWJbqOA6Jg7pOy5vZNjo+REpYe231o+W5oLQ150X5aa0EzR/Ne9SZ YU3Hi0K/kKJwop9sa1OudVAqHL+EqRHYY5LJGnDJZV8yw8y0Zi8oGlYkKBzkxhALmJZD ky/uL/WQc2J4dSzn0lP2qk2tJteJY9TIj8Ks5ysk8kSGgWP4CqKvZTZVmSe4gq1+EZFk BnhR6jki94zV+iF4PLTQErXskpkCUJnpH/mQxUVgfEHJYmIKw7Iu3QOfS5ibdE7d0n19 hpSg== 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=yHCA/KTKwp7B7Kwu2uVf7j6pG80nczXvqIWwVgNqGkM=; b=Ybp2N3fRPRb/NvGTp5UPKf31wKYyl+ssUNxkpIPzJx5uMAfTDMwBVOlFaTH9vcJ36F OQxKkNrj+ynI+o7dyxytPrfY1PrrgqB+JbGPK0usqZL6kheEna0futdlwnLUDB6wci0A 73NJ8urQb3qfPrWsLqN62ixXXDQE47b3lzpOTy+m5Pe7cEbyuJr131Ko4p2QM/WgJoOI 609pae22NiEFNCNjyLVhaybMTKfIcGKr0RCfw6wx35qWChH7CTrlhnPWH3Spe+gptmIc iBhRyBmtgX2IOoy66/G9JVG7K+uvwa0POO1JiODB94p/iydDSl8BWDfaiFMsGkS2YT9D cPbw== X-Gm-Message-State: AFqh2kpwttq622npMXEuE5SruATDI8LMk2nstNJpy6pO437hQ5kR6w5A xDhA1eIyaIuY7TFqMpehY+/Khd0WeFYUHsqL94M= X-Google-Smtp-Source: AMrXdXtcUNQw2fgo8eqqY7FoQbWahEZs76zjjc8V82tkXbwp/tAp02I1NN0F0KPOsD80iOIVi5klgj27oHlt+1+7YYw= X-Received: by 2002:a62:388d:0:b0:576:9786:94c2 with SMTP id f135-20020a62388d000000b00576978694c2mr2087787pfa.26.1672424206044; Fri, 30 Dec 2022 10:16:46 -0800 (PST) MIME-Version: 1.0 References: <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> <44ccf2d5-789f-f122-34f9-25871fdf1283@yandex.ru> <118143a7-0703-2538-9853-7009064e7bca@yandex.ru> <4540a3e6-f736-9050-0aac-0a9be1459248@yandex.ru> In-Reply-To: From: Aaron Jensen Date: Fri, 30 Dec 2022 13:16:35 -0500 Message-ID: Subject: Re: bug#60186: 29.0.60; ruby-mode indentation of multi-line expressions To: Dmitry Gutov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60186 Cc: 60186@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 Fri, Dec 30, 2022 at 1:00 PM Aaron Jensen wrote: > > On Fri, Dec 30, 2022 at 10:02 AM Dmitry Gutov wrote: > > > > Hi Aaron, > > > > On 30/12/2022 00:59, Aaron Jensen wrote: > > > On Wed, Dec 28, 2022 at 4:24 PM Dmitry Gutov wrote: > > >> On 28/12/2022 14:47, Dmitry Gutov wrote: > > >>> 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. > > >> Semantics aside (I suppose we could go back and revise the naming a > > >> little later), could you test this new revision of the patch? > > >> > > >> I think I got the implementation simple enough now. > > >> > > >> The number of options has grown, though: > > >> > > >> (setq ruby-after-operator-indent nil > > >> ruby-block-indent nil > > >> ruby-method-call-indent nil > > >> ruby-parenless-call-arguments-indent nil) > > > I'll give it a shot some more, but these appear problematic: > > > > > > fixture( > > > EntityProjection::Fixtures::Projection, > > > projection, > > > deleted > > > ) do|projection| > > > projection.assert_attributes_copied([ > > > { :document_id => :id } > > > ]) > > > end > > > > > > Should be: > > > > > > fixture( > > > EntityProjection::Fixtures::Projection, > > > projection, > > > deleted > > > ) do|projection| > > > projection.assert_attributes_copied([ > > > { :document_id => :id } > > > ]) > > > end > > > > This example is for https://debbugs.gnu.org/60321, I think. Which we > > split off and postponed a little. > > > > The last patch was the latest revision of the changes for > > https://debbugs.gnu.org/60186. > > My mistake, it seems to work for these things aside from the method > params in the example below. I can't reproduce that in emacs -Q, only > with my own config, so I will have to see if I can figure out what the > difference is. I can't reproduce this anymore, I think it had to do w/ dtrt-indent doing something odd. I had things in a state where some buffers did it and not others and I restarted Emacs before checking the settings. In any case, I think it's fine. I don't have any concerns with the patch as-is. Thanks, Aaron From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 30 17:07:25 2022 Received: (at 60186-done) by debbugs.gnu.org; 30 Dec 2022 22:07:25 +0000 Received: from localhost ([127.0.0.1]:36216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBNXB-0004Y1-4q for submit@debbugs.gnu.org; Fri, 30 Dec 2022 17:07:25 -0500 Received: from mail-ej1-f50.google.com ([209.85.218.50]:35778) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBNX9-0004Xm-VD for 60186-done@debbugs.gnu.org; Fri, 30 Dec 2022 17:07:24 -0500 Received: by mail-ej1-f50.google.com with SMTP id vm8so46822443ejc.2 for <60186-done@debbugs.gnu.org>; Fri, 30 Dec 2022 14:07:23 -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=B7PYE5xuvrkJlvsziG1yy6TorEzDg266jh+KK2k1Hbc=; b=od5Gh4Rtro3pb9QdD9ynR20JNyo6QdfPVwIg6okGevmUSEJNacrP7o8KxgmVs+aq5t IHSjGV8cdN8+Cud0TqElU+pkPH9h7+gKaXdscI7IUTw3yEckGwQVV0ZQZG0kZesmk1eO HoGcnSkXhVu4UuOH3lr6eUjRIfdwNPhCI9Zse6Ntn5YxXWYDzNlPBt6iF67dD8h6FVM3 xMNXCffSs0uQkOTTOiA6Ft8n5FzMHxbObcmMqTJB2z2KctkC6qsNSoIWOSgncdN58fGJ FIg1UdQsm6H7RpWK+OyLlqXwvUzKe9UrSNHGnfRLI4wVaKn7dtzSNtlARws98EpQnLs8 10Gg== 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=B7PYE5xuvrkJlvsziG1yy6TorEzDg266jh+KK2k1Hbc=; b=WQLbTWmcPSNxhAUJRwSMadqKXBS82Y/PPcaavsg+F/1vBu0C8fnzEy4E5oPfXF68WP +i2Evej4NNMcXaM2Y4bUOVy688SN/jeIubwLuq21Jc03oFAseyNkkhi+IQZO4+gRaf+l 7mP3+5CgCFbmES6vsC7CaAOvif0e000AXvTYVPM2E5OqmT9BYQSKAfe3MUitp7QaMpLn 6CPic4EvFj0G3bWOX2IQpHRo7Gtl76JWpJLDRatyg0lqcTS7HhCk5jmWoTqhbAOgWgPu P790IwGv58489NkcY8ZAlvCDFY8d5HdiS3b1dxN7WQvMYkdf2ZaSObp/my2GNBKJWi2q nG1w== X-Gm-Message-State: AFqh2krTE1N6Pc4QbhqjnjibQT13qY5BMb9+hgCC7XL5NRRvuN5zZQmg EsprsufAZtjZPjrbVAA1pPc= X-Google-Smtp-Source: AMrXdXtUFlka+ls+sKZ1/M3ojLnt40xf9bQ1EeuWsLnToAcWhud+h+OZDcC6pdRI9P1opCdottgUZg== X-Received: by 2002:a17:906:9f0a:b0:7c0:e302:b523 with SMTP id fy10-20020a1709069f0a00b007c0e302b523mr34495214ejc.59.1672438038084; Fri, 30 Dec 2022 14:07:18 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id f9-20020a056402004900b0046c7c3755a7sm9822259edu.17.2022.12.30.14.07.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 30 Dec 2022 14:07:17 -0800 (PST) Message-ID: Date: Sat, 31 Dec 2022 00:07:16 +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#60186: 29.0.60; ruby-mode indentation of multi-line expressions Content-Language: en-US To: Aaron Jensen References: <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> <44ccf2d5-789f-f122-34f9-25871fdf1283@yandex.ru> <118143a7-0703-2538-9853-7009064e7bca@yandex.ru> <4540a3e6-f736-9050-0aac-0a9be1459248@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: 60186-done Cc: 60186-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.9 (-) Version: 29.1 On 30/12/2022 20:16, Aaron Jensen wrote: > I can't reproduce this anymore, I think it had to do w/ dtrt-indent > doing something odd. I had things in a state where some buffers did it > and not others and I restarted Emacs before checking the settings. In > any case, I think it's fine. I don't have any concerns with the patch > as-is. Thanks for testing, this is now in the release branch. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 30 20:11:42 2022 Received: (at 60186-done) by debbugs.gnu.org; 31 Dec 2022 01:11:42 +0000 Received: from localhost ([127.0.0.1]:36305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBQPV-0000t2-Nw for submit@debbugs.gnu.org; Fri, 30 Dec 2022 20:11:42 -0500 Received: from mail-pf1-f177.google.com ([209.85.210.177]:39595) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBQPT-0000sq-SQ for 60186-done@debbugs.gnu.org; Fri, 30 Dec 2022 20:11:40 -0500 Received: by mail-pf1-f177.google.com with SMTP id w26so15357020pfj.6 for <60186-done@debbugs.gnu.org>; Fri, 30 Dec 2022 17:11:39 -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=6YVsimSLLIiPRYNLhMaDF9LuoEQIM1YwgqB/Ci+EE78=; b=fL4vMIvv5OTUUeQwSo9++bSlreDMO+2W4JeqNtwO9zthmvTUOvFdKMehuAjT4ceMM+ +VXTTJG8X8OQvy/AbgfhOqnmqOR0qr+YkAkIj8g20Dq2oHlpCi1Yr4obDjadsLy3DQAM b+deLtDQSCZUhBuGv4BSyomLcZFS1+ciwTgPAEIIRXIecPehngEdVLogJUkv95MBVTrf Oa5kgXyqieI3dZqoQJKYhzVqifMEs+/ErmDPQbG8bmp/Kax2Sh5qH3FqbIEG9gs9kzHS O2S6YoflrfjeIL6e/fEI6SC9s61iaWKpq75xpD/I9GkDHZE0P5Hh79Q6+m12Etm32vxF tBhg== 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=6YVsimSLLIiPRYNLhMaDF9LuoEQIM1YwgqB/Ci+EE78=; b=jGXha5Zp3XkMstSG3+iYOkC4CvoyI/rEhUeZhct6I5FZ8fnBKGMFeox6XH9m9mKxu9 jzmTe47LVmsksxe2UI7AcpUmSf6ArlulZzJRIdY91VKNEJbmbFve79AcuF3as9zu0qht AANCuJP0roYUYw7yTGB6J6/Hg9bv1olxYp8zEIMjFA07dpIruj2CuYXprnPOGQk4rYay pYZyPI3MtbsoTu7D5ekZWJy7GDUf6fIQGmsP8AEJNzwKb8JxHIDl2Ge4kQYyTTSbGyug 1YdnkjjzU+8+ycRBVkM+/dHyJ77MBm5L8fMjvItPU+okCeyX81LpXMzvc+/OLOYj7HJ9 LWtA== X-Gm-Message-State: AFqh2ko16+LFnbjuADz3D3zfUnTzb/U4smx2J54NKTBFDDPi76w8l6Qm B9+es+SKx1ytjjzHd13eFriLal+aQWF37ILmJ0k= X-Google-Smtp-Source: AMrXdXt/SKWL2PapC0Lh+QzNj3ElSVhqAjjrpHgX+CObTfdg6znjqi64mwXL/VAuMzVNvoovxAXl/unqnr3AiUhtCew= X-Received: by 2002:a05:6a00:1898:b0:57a:a199:9027 with SMTP id x24-20020a056a00189800b0057aa1999027mr2076233pfh.13.1672449093965; Fri, 30 Dec 2022 17:11:33 -0800 (PST) Received: from 649336022844 named unknown by gmailapi.google.com with HTTPREST; Fri, 30 Dec 2022 17:11:33 -0800 Mime-Version: 1.0 X-Mailer: Superhuman iOS 10308 X-Superhuman-ID: lcb8zvda.41c45cbe-d325-4642-910f-6b5b992644d1 References: <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> <44ccf2d5-789f-f122-34f9-25871fdf1283@yandex.ru> <118143a7-0703-2538-9853-7009064e7bca@yandex.ru> <4540a3e6-f736-9050-0aac-0a9be1459248@yandex.ru> X-Superhuman-Draft-ID: draft003f254796457548 In-Reply-To: From: Aaron Jensen Date: Fri, 30 Dec 2022 17:11:33 -0800 Message-ID: Subject: Re: bug#60186: 29.0.60; ruby-mode indentation of multi-line expressions To: Dmitry Gutov Content-Type: multipart/alternative; boundary="000000000000269d1105f11566e2" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60186-done Cc: 60186-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 (-) --000000000000269d1105f11566e2 Content-Type: text/plain; charset="UTF-8" Thank you. Aaron On Fri, Dec 30 2022 at 5:07 PM, Dmitry Gutov wrote: > Version: 29.1 > > On 30/12/2022 20:16, Aaron Jensen wrote: > > I can't reproduce this anymore, I think it had to do w/ dtrt-indent doing > something odd. I had things in a state where some buffers did it and not > others and I restarted Emacs before checking the settings. In any case, I > think it's fine. I don't have any concerns with the patch as-is. > > Thanks for testing, this is now in the release branch. > --000000000000269d1105f11566e2 Content-Type: text/html; charset="UTF-8"
Thank you.


Aaron

On Fri, Dec 30 2022 at 5:07 PM, Dmitry Gutov <dgutov@yandex.ru> wrote:

Version: 29.1

On 30/12/2022 20:16, Aaron Jensen wrote:

I can't reproduce this anymore, I think it had to do w/ dtrt-indent doing something odd. I had things in a state where some buffers did it and not others and I restarted Emacs before checking the settings. In any case, I think it's fine. I don't have any concerns with the patch as-is.

Thanks for testing, this is now in the release branch.

--000000000000269d1105f11566e2-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 21 22:02:51 2023 Received: (at 60186-done) by debbugs.gnu.org; 22 Jan 2023 03:02:51 +0000 Received: from localhost ([127.0.0.1]:50198 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJQd9-0003vw-8O for submit@debbugs.gnu.org; Sat, 21 Jan 2023 22:02:51 -0500 Received: from mail-wr1-f50.google.com ([209.85.221.50]:40583) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJQd7-0003vi-9n for 60186-done@debbugs.gnu.org; Sat, 21 Jan 2023 22:02:49 -0500 Received: by mail-wr1-f50.google.com with SMTP id r2so7945848wrv.7 for <60186-done@debbugs.gnu.org>; Sat, 21 Jan 2023 19:02: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:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=XPSae2fXD1In2YfQlOOYm8LodxAkrIf/HFLM08Icv3o=; b=ZXjIa0nY2TjvnhMMw/iOcjwp/HquTiGG3VThzU9GwqWRrTJhOjAZD/d+XkmHn1K9PG tJMDIzHD4DiiaXy3KH/r4dzfXonIEqZ8wTyHUoO+8NCCBODv9ApJ7H7qfWtLa3Cyyeay vMJhSRgcn1IoyGS5gSIoZQyUb7yKf9MoWEEGeq5FbP07pOXh6ZlxqSsY8oxr89yx0GtR vtrhBA8o+4q0ayjtRU8F4tQsrFPf+1G2OD45KAQXbRH4TWUjKGualQHEhafoezh5kaPP Hywzt5I2yDEWNmUitowsoXum2oENPXCR3Tf0DQdSCVb9sqPirgn4bcbGtnjYEHfzAT/F ElPQ== 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=XPSae2fXD1In2YfQlOOYm8LodxAkrIf/HFLM08Icv3o=; b=GLIXcMkNakt+kKZYOxDKXT/n7fcS0QLsVElX4SY6gQkPM8Hml02iCWbGRXpEe68WlE 0BZmQwU/7P92b5Tg+aIsf83Eyz6dy8XWweNDLzeooIBAMMTp7sUWDwuSi0Gv05Vf+91x YtQslUh5ggRViF2ZBhjKJ3ONe4ysN1KrQ+77BFcAaqpCRYzRPDoRnD2eyp3sb3cPpiip jvUO7g/AukPVx4LUz9MyYGkYfaf0Xjl74S5OopoKqUyn4ed2uiWH70bYCaaMkYvYzgci uf8IR49ax2EyNTKnj6bXcS5M/DFs1/PdMBvTXrIsc42vsNpcLKv5RfWKlfGntgwD0F5V ajdA== X-Gm-Message-State: AFqh2koD3AES10N8Sk2sMxMOu7UrNV97XlLUTMEjgPEXh2vhcHU4y9bl DdjWk0/iC0zKwBsFK8YXEx8= X-Google-Smtp-Source: AMrXdXsO/iIBoaguzRQXX7AsuA7nGGYPsnNDNbF8v/SCJ4yo2502pDq7M07Hy0LmuUyi69Nu8tLGpA== X-Received: by 2002:adf:e109:0:b0:2bd:de40:21f9 with SMTP id t9-20020adfe109000000b002bdde4021f9mr13042318wrz.61.1674356563127; Sat, 21 Jan 2023 19:02:43 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id k3-20020a5d6e83000000b00289bdda07b7sm1295314wrz.92.2023.01.21.19.02.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 21 Jan 2023 19:02:42 -0800 (PST) Message-ID: <2088c5e8-2855-739c-18fe-8293621406f4@yandex.ru> Date: Sun, 22 Jan 2023 05:02:40 +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#60186: 29.0.60; ruby-mode indentation of multi-line expressions Content-Language: en-US To: Aaron Jensen References: <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> <44ccf2d5-789f-f122-34f9-25871fdf1283@yandex.ru> <118143a7-0703-2538-9853-7009064e7bca@yandex.ru> <4540a3e6-f736-9050-0aac-0a9be1459248@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: 60186-done Cc: 60186-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.9 (-) Hi Aaron, Now might be good to test how ruby-ts-mode works with all ruby-mode's indentation variables, too. If you have the time. It should work support all of them now, but I might have missed some edge cases. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 22 00:15:47 2023 Received: (at 60186-done) by debbugs.gnu.org; 22 Jan 2023 05:15:47 +0000 Received: from localhost ([127.0.0.1]:50400 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJShm-0007Ds-A5 for submit@debbugs.gnu.org; Sun, 22 Jan 2023 00:15:47 -0500 Received: from mail-pl1-f178.google.com ([209.85.214.178]:41846) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJShU-0007DQ-Rs for 60186-done@debbugs.gnu.org; Sun, 22 Jan 2023 00:15:44 -0500 Received: by mail-pl1-f178.google.com with SMTP id jl3so8635814plb.8 for <60186-done@debbugs.gnu.org>; Sat, 21 Jan 2023 21:15:28 -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=KyukxJDTjOLTjqu3fKPdxsTGp2nPz4x/WNp5TeBbvkI=; b=NAMjoEYdClRGgFPwn+1qWT5lcvXMyKiiq7B7+vYersn1VkPzCXkThq+JiU2llSp7U0 sazTcVnPzWrAMku2an2XDuVTjNo7mBh579C7VUf7eV/XdHRISlCm1rvAEQfCSilowldl Y10DsBpHyXFmpqzJGPZsCXmqkcvwRIDeRZwuN6InZNJ4xp9cVVp7bZdn5KusAY15PsFY P36vTl0o6BMoEUlNPjBy98WIi0D+H+ORcAdpkJ4aVVjzwUeGyDV1WkgDcAzLsmf9nCMf wGZOwWL0t8xzsZi/KWoA0cqx19RkVzoXfjlWnI86GTCQCr6NBffUfgmj3iYEAf8nwAuL lA7g== 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=KyukxJDTjOLTjqu3fKPdxsTGp2nPz4x/WNp5TeBbvkI=; b=0Su28L4HOitBPOYj1ev1n3odzhnwV9xZ9c9KgqrXMAcZ9R2dZjgue+PTd1euGOScXc 2Wkuj/nGbOb3NMJNkvQkiG+Vw6QgWeFjY/AXXo8UepcdquCF3Av0HP2f+PU1SKQylgn1 Y9o1RtFiCeI+iJjs/9KrweA0G/SOpverFpmbyOxPHzRd4jA1AErru9Uyxx1GVcVfSY0K sJysPULCvA0NO4KmIgXhsCTAr9pjHC8r4alCJIHroAVLMf6cVtyfhm1uqy0Fk8MmplOC ysOozC99Dh7GtHgoNaW8kvLAkdv7e74wppPcxc68yGv2Imr66oBiqTFFhxDqHmb4p3wW gfcA== X-Gm-Message-State: AFqh2kqPRDaDZuhkMCITmnalEasWLp6RZwcVDWZ8zW80d8AX6AXUWsMx x+hb1OZ9x/33bivve/mtpPt5U31LhkKPmf2XVqc= X-Google-Smtp-Source: AMrXdXuRGiheKml6uvWaXbkUEV6xnjol/+VjFcbwZC5cFsZfe0Irb6Y1tsraJrO3VZ6ruOCb4yhDo6CXtnuHweT0RxE= X-Received: by 2002:a17:90b:3717:b0:226:9d77:e730 with SMTP id mg23-20020a17090b371700b002269d77e730mr2093775pjb.198.1674364522720; Sat, 21 Jan 2023 21:15:22 -0800 (PST) MIME-Version: 1.0 References: <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> <44ccf2d5-789f-f122-34f9-25871fdf1283@yandex.ru> <118143a7-0703-2538-9853-7009064e7bca@yandex.ru> <4540a3e6-f736-9050-0aac-0a9be1459248@yandex.ru> <2088c5e8-2855-739c-18fe-8293621406f4@yandex.ru> In-Reply-To: <2088c5e8-2855-739c-18fe-8293621406f4@yandex.ru> From: Aaron Jensen Date: Sun, 22 Jan 2023 00:15:11 -0500 Message-ID: Subject: Re: bug#60186: 29.0.60; ruby-mode indentation of multi-line expressions To: Dmitry Gutov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60186-done Cc: 60186-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 Sat, Jan 21, 2023 at 10:02 PM Dmitry Gutov wrote: > > Hi Aaron, > > Now might be good to test how ruby-ts-mode works with all ruby-mode's > indentation variables, too. If you have the time. > > It should work support all of them now, but I might have missed some > edge cases. Hi Dmitry, I played around with it briefly and nothing stood out. It looks pretty good. I'll try switching to it for daily use and report back if I find anything. Thank you. Aaron From unknown Thu Aug 14 20:53:14 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 19 Feb 2023 12:24:11 +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