From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 22 15:33:27 2011 Received: (at submit) by debbugs.gnu.org; 22 Jul 2011 19:33:27 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QkLTS-0000lC-7u for submit@debbugs.gnu.org; Fri, 22 Jul 2011 15:33:26 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QkLTQ-0000l1-GE for submit@debbugs.gnu.org; Fri, 22 Jul 2011 15:33:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QkLTK-0006IP-Bb for submit@debbugs.gnu.org; Fri, 22 Jul 2011 15:33:19 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:34077) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkLTK-0006IC-9Z for submit@debbugs.gnu.org; Fri, 22 Jul 2011 15:33:18 -0400 Received: from eggs.gnu.org ([140.186.70.92]:60772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkLTJ-0005td-BB for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2011 15:33:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QkLTI-0006Hm-FZ for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2011 15:33:17 -0400 Received: from mail-fx0-f52.google.com ([209.85.161.52]:63661) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkLTI-0006Hc-85 for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2011 15:33:16 -0400 Received: by fxd18 with SMTP id 18so4675574fxd.39 for ; Fri, 22 Jul 2011 12:33:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=g+Pb3zhGkBsxawrJgeGBcRh1ZyybIWrkxezzag7d9+8=; b=r3Z0HEIEPyVMyLJ8a2ciD8i9vz93kIbXhPaZsHBySyhPCIjwv1WQBs5jZQlcFn5hMd ohIe5CEUW+TofVkcs/hBkuOp9lU5ZaPXcTFzJxODpEuzEBAppnsK8K8k4gVb1cqkyKiy xFPMI7L7dWDqNl7i/AG7J6i3aLM0oP3LI8lwQ= Received: by 10.223.21.219 with SMTP id k27mr287151fab.54.1311363195141; Fri, 22 Jul 2011 12:33:15 -0700 (PDT) Received: from localhost (176.119.broadband10.iol.cz [90.177.119.176]) by mx.google.com with ESMTPS id b14sm756151fam.21.2011.07.22.12.33.13 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 22 Jul 2011 12:33:14 -0700 (PDT) From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= To: bug-gnu-emacs Subject: js-mode indentation doesn't recognize brace-less function expressions Date: Fri, 22 Jul 2011 21:28:45 +0200 Message-ID: <8762mu5d3m.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -4.8 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.8 (----) GNU Emacs 24.0.50.6 (i686-pc-linux-gnu) of 2011-01-15 on headley In JavaScript, the following is a valid function definition: function foo () a.somewhat().complicated() .computation() but `js-mode' currently indents it like this: function foo () a.somewhat().complicated() .computation() --=20 =C5=A0t=C4=9Bp=C3=A1n From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 21 12:06:41 2019 Received: (at 9151) by debbugs.gnu.org; 21 Aug 2019 16:06:41 +0000 Received: from localhost ([127.0.0.1]:36394 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i0T8C-0000vF-T0 for submit@debbugs.gnu.org; Wed, 21 Aug 2019 12:06:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i0T7v-0000uY-N8 for 9151@debbugs.gnu.org; Wed, 21 Aug 2019 12:06:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43873) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1i0T7q-00025b-J5 for 9151@debbugs.gnu.org; Wed, 21 Aug 2019 12:06:18 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1i0T7p-0003Wq-B9 for 9151@debbugs.gnu.org; Wed, 21 Aug 2019 12:06:17 -0400 Resent-Message-ID: <23901.27640.218604.458130@gnu.org> Resent-Date: Wed, 21 Aug 2019 12:06:16 -0400 Resent-From: Glenn Morris Resent-To: 9151@debbugs.gnu.org Bcc: rgm@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Yj17Pc16TR2Qk1WYppBqG7U7cN8SOAoeOIcbiqDHpKg=; b=fm1nyntpV42b/2DU3Fn8dT/HupJjixbJ4wWARcGSf1KFiba1xyv5nRTJzFlHieYv8T o7fmG22Rg0+Re6NOMLU8jlzDeBglw0ylZQz4S9SqDW3ByXfQTsbr/IMIVbgBUqNTvoxJ 0VwPyU3v/q6G99/n38l9+SBRVi2Po3mBIHSTDciAhi0ENnwWBen4Z6nHroTD8JY1bNxi JmMet87SyfdD2Uj3jSHS7xBZmexCQw57AA3bUgj1SaEzbPB96hGGa/9A+Bd4mUd2ZXSF gHNmWMYsewlXOxC0gkLLRvR5xhf9+wRF0D1DE5Tm66ierf/TiQ6kWHWyOrtIRVfz0xpK JmaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Yj17Pc16TR2Qk1WYppBqG7U7cN8SOAoeOIcbiqDHpKg=; b=M738P8K8/WuHOwGNFyLWeMKIN0CBXXnrOgjX6s91tOBtZGIRvuYe5UWRyVH5Ga36eH TEmbWU3tGEmiB9W6+KAEHftXqrZ5FvpeC9gJQtUOaen32qMQ/QC+BpAGnroIv+Vh/h0u hobKDgTQdq/5SDvoH3H9ucOO2070JhGfxjN3I04xoCMw+/l+yOkN4OCM2l5q5NJmBT/D wOfnSvlssWJRoOYCjAWD5Q+OxxoVS4Z1IXhyZPl9Ds+bnBEFUHsKO1E9KEMIm74FXRqZ qxKH91YbhlBHETtahKQ7DJ/QZype59Vh1U44ROhqrcKE0nynEHuhIQyIqwcTGf97Amf8 N+dw== X-Gm-Message-State: APjAAAXlzDmUo1PDek04exg/QUxTe9hEPzXFbQx7D7fjTS1QSRh6qTxC OcTkNZG1fSiP+/eEX+3fZC7p3dnS+vcu7gZm36ONz1GJJVk= X-Google-Smtp-Source: APXvYqzSQPnyL8GVsh9MEOynlVUWDhzXo5LGg6b4UXkDqRYYCuj6n2sTvY7atOmok8O0G6Uv1RBfVHxoKVKhmXFBSNo= X-Received: by 2002:a9d:1ca3:: with SMTP id l35mr24636541ota.106.1566374069977; Wed, 21 Aug 2019 00:54:29 -0700 (PDT) MIME-Version: 1.0 Message-ID: Content-Type: multipart/alternative; boundary="00000000000006c97405909be28c" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::32b Date: Wed, 21 Aug 2019 09:54:18 +0200 From: =?UTF-8?Q?Knut_Olav_B=C3=B8hmer?= To: 9151@debbugs.gnu.org Subject: bug#9151: js-mode indentation doesn't recognize brace-less function expressions X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 9151 X-Mailman-Approved-At: Wed, 21 Aug 2019 12:06:39 -0400 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.0 (---) --00000000000006c97405909be28c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable This bug is probably more important to day then 8 years ago because of the widely used arrow function with concise body syntax as documented here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions= /Arrow_functions#Function_body Right: const something =3D () =3D> indent_like_this(); Wrong: const something =3D () =3D> not_indent_like_this(); --=20 Knut Olav B=C3=B8hmer --00000000000006c97405909be28c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
This bug is probably more important to day then 8 years ag= o because of the widely used=C2=A0 arrow function with concise body syntax = as documented here:

Right:
const something =3D () = =3D>
=C2=A0 =C2=A0 =C2=A0 indent_like_this();

Wrong= :
const something =3D () =3D>
not_indent_like_this();

--
Knut Olav B=C3=B8hmer
--00000000000006c97405909be28c-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 03 15:48:34 2024 Received: (at 9151) by debbugs.gnu.org; 3 Jun 2024 19:48:34 +0000 Received: from localhost ([127.0.0.1]:55703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEDfV-0008V3-UH for submit@debbugs.gnu.org; Mon, 03 Jun 2024 15:48:34 -0400 Received: from mail-4317.proton.ch ([185.70.43.17]:62873) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEDfO-0008UQ-7b for 9151@debbugs.gnu.org; Mon, 03 Jun 2024 15:48:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kubajecminek.cz; s=protonmail; t=1717444085; x=1717703285; bh=elpskmPTu4mm8/DERVQPoMDboMsOS4th1Xu3weiHSDo=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=Re594diRF5eE9SqerPQA6r6UrNGxpMH2QVJz+Kmhpv9P/AE/r4qrRwHBzaVcCbdbe Q68yUbZwTG8CGAt14dwDkP9Tjds8QC02kYnz0wFl+ce6vhOlY3wrXI751PZTjSywXo 7Ul1d3XTyy+FTT/TQ/1tveg1lZJnBcyhVaDN2hevcip+X5J5FkDzPasZwL/zgb2DRc L3D3O4qIIxxiAuWnMHOoiLMF5vq+gaN7fLYI+zdT/jOXx7FC5s4xLGQAVc90PUCIeA H0Tibp3GntKxFfuOkVPhxV+dO5OcSONNkqYROfn4iIo3+rjbgeM6X6PfDw31d5JI1j UL5zwiP276+Sg== Date: Mon, 03 Jun 2024 19:48:01 +0000 To: =?utf-8?Q?Knut_Olav_B=C3=B8hmer?= From: =?utf-8?Q?Jakub_Je=C4=8Dm=C3=ADnek?= Subject: Re: bug#9151: js-mode indentation doesn't recognize brace-less function expressions Message-ID: <87bk4h95ap.fsf@kubajecminek.cz> Feedback-ID: 98803324:user:proton X-Pm-Message-ID: 966722fb8f0d19d3716069188624039beaadb327 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 9151 Cc: 9151@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.3 (/) Knut Olav B=C3=B8hmer writes: > Right: > const something =3D () =3D> > indent_like_this(); > > Wrong: > const something =3D () =3D> > not_indent_like_this(); This indents correctly for me. =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec writes: > In JavaScript, the following is a valid function definition: > > function foo () > a.somewhat().complicated() > .computation() > > but `js-mode' currently indents it like this: > > function foo () > a.somewhat().complicated() > .computation() I know virtually nothing about JavaScript but your example function doesn't seem valid. If you add curly braces and set `js-chain-indent' to t then it works fine.