From unknown Sat Jun 21 10:23:24 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#23015 <23015@debbugs.gnu.org> To: bug#23015 <23015@debbugs.gnu.org> Subject: Status: 25.0.92; ruby-mode misindents arguments of a method call inside continuation Reply-To: bug#23015 <23015@debbugs.gnu.org> Date: Sat, 21 Jun 2025 17:23:24 +0000 retitle 23015 25.0.92; ruby-mode misindents arguments of a method call insi= de continuation reassign 23015 emacs submitter 23015 Dmitry Gutov severity 23015 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 14 20:27:40 2016 Received: (at submit) by debbugs.gnu.org; 15 Mar 2016 00:27:40 +0000 Received: from localhost ([127.0.0.1]:48307 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1afcpo-0005Fr-41 for submit@debbugs.gnu.org; Mon, 14 Mar 2016 20:27:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57335) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1afcpm-0005Fe-CT for submit@debbugs.gnu.org; Mon, 14 Mar 2016 20:27:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afcpg-0004W0-5T for submit@debbugs.gnu.org; Mon, 14 Mar 2016 20:27:33 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:45606) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afcpf-0004Vw-Uv for submit@debbugs.gnu.org; Mon, 14 Mar 2016 20:27:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afcpe-0002Sn-8X for bug-gnu-emacs@gnu.org; Mon, 14 Mar 2016 20:27:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afcpL-0004OI-FC for bug-gnu-emacs@gnu.org; Mon, 14 Mar 2016 20:27:30 -0400 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:33299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afcpL-0004OE-6C for bug-gnu-emacs@gnu.org; Mon, 14 Mar 2016 20:27:11 -0400 Received: by mail-wm0-x22b.google.com with SMTP id l68so123452241wml.0 for ; Mon, 14 Mar 2016 17:27:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version; bh=C0QkYdKnH+CwTCXX04TE5D/oKG8kDpNG3LmaPxx/HWE=; b=MybuwVuGQXuumDcczoZpIr5uBGAI+b5kcb9CRBwHKdQE+CjIxQpBrcv4SfwkACQNFg dsLY5EOb5QupNUYuK9KdjkGjuJmCdRkIz/X8t9zmiqr4dmlgIgu4P9JeCB81DOlHAhtm v+Xgh166BXMldxEVArb36PyLcPcKrbu0VqwKvrBNc5LD8JoD8IZKs2zWogqc+FFfX0Gd LIlBm2/KdM3JkxndGozMj16Zfeyfu7/4fNeQdecPn7cALLsj7mAYHgZbUH2cQ1uDTIGG diAYMBr8wsmfQTp2l+ovoG6gPCHawpKL/3kPeYPchP5awdsqmkK7wMUGVOvXym5t/9I8 Rl1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version; bh=C0QkYdKnH+CwTCXX04TE5D/oKG8kDpNG3LmaPxx/HWE=; b=VaKLK7Zr9J6jHx/u9OUrdwzLF1IYd6sDBmWZiGW8/f5UUiWlL7qFo7wBmGwUFGDUS3 umYV0hc/zwpQ7O3Xq29142u+PRwnA1Ud6cHXslr5qnL4PhpDyUIlDnRfXsfj6pNlf1Ch 6GLaLQE3UF2q5Mdwym1X3HxWpbBNodYL4g1CUv/BuKslM6BS/2DHgM/hZVseKNv4y+4B r1i38ENbmoSqsr7uB7zWS/0c30aHJHpBTMj7k6q1701STct2zLvFL6y7PoKb6ph3u2FK a2BjbPS5BVd9uAY3vWkZo7smzj4sVXie+ECNRmpMgL11vxpTuvDNpOWZ74t2/0Fffpvy 5Ukw== X-Gm-Message-State: AD7BkJIb9jqjPAf7H6ctMVC/sDqmuZp+jdz5CDp/keEF9cto/e7U6URxj44WahvilXPwJA== X-Received: by 10.28.217.82 with SMTP id q79mr20661858wmg.29.1458001630174; Mon, 14 Mar 2016 17:27:10 -0700 (PDT) Received: from axl ([185.105.175.24]) by smtp.gmail.com with ESMTPSA id ka4sm24487196wjc.47.2016.03.14.17.27.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Mar 2016 17:27:09 -0700 (PDT) From: Dmitry Gutov To: bug-gnu-emacs@gnu.org Subject: 25.0.92; ruby-mode misindents arguments of a method call inside continuation Date: Tue, 15 Mar 2016 02:27:05 +0200 Message-ID: <86mvq0a8me.fsf@yandex.ru> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) 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.8 (---) --=-=-= Content-Type: text/plain It indents foo = subject.update( a: 1 ) whereas it should be foo = subject.update( a: 1 ) Patch attached. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=call-inside-continuation.diff Content-Description: patch diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 1c9f0f4..35d0cc4 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -629,19 +629,13 @@ ruby-smie-rules ;; because when `.' is inside the line, the ;; additional indentation from it looks out of place. ((smie-rule-parent-p ".") - (let (smie--parent) - (save-excursion - ;; Traverse up the parents until the parent is "." at - ;; indentation, or any other token. - (while (and (let ((parent (smie-indent--parent))) - (goto-char (cadr parent)) - (save-excursion - (unless (integerp (car parent)) (forward-char -1)) - (not (ruby-smie--bosp)))) - (progn - (setq smie--parent nil) - (smie-rule-parent-p ".")))) - (smie-rule-parent)))) + ;; Traverse up the call chain until the parent is not `.', + ;; or `.' at indentation, or at eol. + (while (and (not (ruby-smie--bosp)) + (equal (nth 2 (smie-backward-sexp ".")) ".") + (not (ruby-smie--bosp))) + (forward-char -1)) + (smie-indent-virtual)) (t (smie-rule-parent)))))) (`(:after . ,(or `"(" "[" "{")) ;; FIXME: Shouldn't this be the default behavior of diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb index 6ab814a..6793bfd 100644 --- a/test/indent/ruby.rb +++ b/test/indent/ruby.rb @@ -405,6 +405,17 @@ zoo a.records().map(&:b).zip( foo) +foo1 = + subject.update( + 1 + ) + +foo2 = + subject. + update( + 2 + ) + # FIXME: This is not consistent with the example below it, but this # offset only happens if the colon is at eol, which wouldn't be often. # Tokenizing `bar:' as `:bar =>' would be better, but it's hard to --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 14 21:26:06 2016 Received: (at 23015-done) by debbugs.gnu.org; 15 Mar 2016 01:26:06 +0000 Received: from localhost ([127.0.0.1]:48326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1afdkM-0006qx-4d for submit@debbugs.gnu.org; Mon, 14 Mar 2016 21:26:06 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:36038) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1afdkK-0006qR-IT for 23015-done@debbugs.gnu.org; Mon, 14 Mar 2016 21:26:04 -0400 Received: by mail-wm0-f48.google.com with SMTP id n186so131918569wmn.1 for <23015-done@debbugs.gnu.org>; Mon, 14 Mar 2016 18:26:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=VLTusU6wovtMTX+JBCa/kEsAFnubLYORkW1/NhQGgdQ=; b=raIruQG3ypvFaS72OGVLSev6qydqiXkEwc05te7f6sbjfJ6Nmwb3XEiW4yNJjlypt6 d9TS7S6KTFMc0uu/eG4Y7hWevyYyUGA0lPuo/JTySFhg+cw9rtmXUP1mZJsuag3LWYfj 0jljWx17okNhQF4RPmxOesxGqQsNewk6DffJugDoCILhoq5/09Eq2skKZEnPHnOICmHM XSHFa1vJfQes7zgKVootbaraIHfXzbvNi2vdF8sMZKXC+UXWmfwXXAaLrpjAQMb2tBou 1O+17ykxJ9Mg/MVVNQeK6P6jxObGvJjqIOYBF6dDFVjfIvfkIDF8eSoEb0Mo1YnetkN0 BkrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=VLTusU6wovtMTX+JBCa/kEsAFnubLYORkW1/NhQGgdQ=; b=JRHnVXftSAg/L8Xc9b6wV0jbLvtRezzo43TSsuVhr1eqb9IeIZ2cqSGWqIZG+ahoBC r97qYNanIuICc/xQXRS7o9I1mtflTKDh2irfHCUId3ruzpJY+9bOFxaHYjnF8ehIwHtG 2zCIIHGZqGZffoOK8QvM3qTZkiU/WWPQen8ooDoJ+Wbvn3YauU/+JtsC3JDZWUZOxcNk +5SAYRILQvRJdVl+fmdWz8JRvDU67Bvy5Vj/k/OXmx+159jMD1XvdQ74Tqo+jitKJt3O 2pdM7vN9TiiqanQWbKEydmqYLHgmweMKBwDt59gPxi9ell4B0k/UOQ2XdrWaRyjDvJrh Ktkg== X-Gm-Message-State: AD7BkJJxRuQ9wI+zPrnXBCqMHFiGF/bhwKSC40oc52G2co8mZe9qSDTTAYYhklSlnBg7qQ== X-Received: by 10.194.249.42 with SMTP id yr10mr27160157wjc.12.1458005158828; Mon, 14 Mar 2016 18:25:58 -0700 (PDT) Received: from [192.168.1.2] ([185.105.175.24]) by smtp.googlemail.com with ESMTPSA id s66sm18570748wmb.6.2016.03.14.18.25.57 for <23015-done@debbugs.gnu.org> (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 Mar 2016 18:25:57 -0700 (PDT) Subject: Re: bug#23015: 25.0.92; ruby-mode misindents arguments of a method call inside continuation To: 23015-done@debbugs.gnu.org References: <86mvq0a8me.fsf@yandex.ru> From: Dmitry Gutov Message-ID: <7ef7b5ae-3cbf-f2db-6116-83d2af367856@yandex.ru> Date: Tue, 15 Mar 2016 03:25:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <86mvq0a8me.fsf@yandex.ru> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 23015-done 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.5 (/) Fixed in emacs-25. From unknown Sat Jun 21 10:23:24 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 12 Apr 2016 11:24:03 +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