From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#40760: 27.0.50; An indentation problem with const and chaining in js-mode Date: Wed, 23 Mar 2022 02:46:45 +0200 Message-ID: <77d4627a-8e73-ce5c-c027-01813cbedbb9@yandex.ru> References: <87r1wf99id.fsf@mbork.pl> <87fsnkoosu.fsf@gnus.org> <87ilsgvo2q.fsf@mbork.pl> <0f3dfed4-f61a-87f9-6325-ca9d80e7077e@yandex.ru> <87czifq0sn.fsf@mbork.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7158"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Cc: Lars Ingebrigtsen , 40760@debbugs.gnu.org To: Marcin Borkowski Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 23 01:47:25 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nWp9o-0001hR-Jq for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Mar 2022 01:47:24 +0100 Original-Received: from localhost ([::1]:37770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nWp9n-0005M6-CY for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Mar 2022 20:47:23 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:54252) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWp9U-0005Lp-Ky for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2022 20:47:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48259) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nWp9S-0005qA-Ke for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2022 20:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nWp9S-00023I-BS for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2022 20:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Mar 2022 00:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40760 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 40760-submit@debbugs.gnu.org id=B40760.16479964167876 (code B ref 40760); Wed, 23 Mar 2022 00:47:02 +0000 Original-Received: (at 40760) by debbugs.gnu.org; 23 Mar 2022 00:46:56 +0000 Original-Received: from localhost ([127.0.0.1]:42156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWp9M-00022y-12 for submit@debbugs.gnu.org; Tue, 22 Mar 2022 20:46:56 -0400 Original-Received: from mail-ej1-f54.google.com ([209.85.218.54]:46684) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWp9J-00022k-O5 for 40760@debbugs.gnu.org; Tue, 22 Mar 2022 20:46:54 -0400 Original-Received: by mail-ej1-f54.google.com with SMTP id qx21so39572759ejb.13 for <40760@debbugs.gnu.org>; Tue, 22 Mar 2022 17:46:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=izDMR3u3cnKsDtYRxxHhEIQbiVp1uk9gNkngyVkq6XU=; b=dDJTWZWB4CzLXb/7OOjBQNW3POR1eSs7Aog4MqrxLixO1KkYb3ZT2svroJJtMwAVnz xZm7Q2yZ9pLIcTZRWLysJyPGnLes+DLYVXrSvJT+nQs+VeK6K7moe1JwYztvKo7m6sZj ZbbnHvyLNkUoGsodI3rfgauMGyJhJg6sPj/ZTzC7ZWIt0pTwG17Pw6FCCG9Eao7Z6tML EXKEqi4d0lff0qE68bsb5X3fjAGunbjemSrK2Go601ZqACNaXDfKnxhWsp3Fwhl6Pnfq FdGTjVTSwAWwArwRY5+BiNeojkVr9iSe//lMstlzYzy9gXba2uI+eOtbFM3TnSjuvzmj XSxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=izDMR3u3cnKsDtYRxxHhEIQbiVp1uk9gNkngyVkq6XU=; b=VQV6H7XT414eQshIpHhpzhK6BWXYl3mlkq4G9R1QE/qByxoJ9SR83+D3/ofJX5a/lk H7tJYMPo6VbY9dImf2UwZ2qFKWzaIq8RpHnJFqRtv9LK5IueGQlrTbDQTUYuk1W41rTL IaPct35dweWmPn55wwWrM+zypP9VD/NXFIzO3YpjaPpNAV/xdrfYn/Rsz9oDQ8mZE3ZW qFs3Xv2FxYiUBhAuM2T++XOmGbnwTvRbnK5lfwr2bt9R1dW5HePyXKXnlstyoNTHGXyl fLKhbLo5ziO3Sgl8nRz/qIb4RfW+c/chSViY+N0HcM+SuneZ9l9FFPLvG/494POvQi5r wxCg== X-Gm-Message-State: AOAM532GbVnzKuqfJiJEq6KKk7EGAc6zu2Jue9HfLMyqzbtt8bAqTzfc ePAJ3pGSPZ6pOOdLMGjHb14= X-Google-Smtp-Source: ABdhPJyRldbPXpKpFy4BDpjDeYaFZl1wjUPgEboxIsptufg4R73mPMmMndDSqwaQDCLuFKdeBtL4NQ== X-Received: by 2002:a17:906:99c2:b0:6df:8834:4f4c with SMTP id s2-20020a17090699c200b006df88344f4cmr28470116ejn.496.1647996407661; Tue, 22 Mar 2022 17:46:47 -0700 (PDT) Original-Received: from [192.168.236.48] ([173.237.64.48]) by smtp.googlemail.com with ESMTPSA id g21-20020a056402115500b00413c824e422sm10368800edw.72.2022.03.22.17.46.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Mar 2022 17:46:47 -0700 (PDT) Content-Language: en-US In-Reply-To: <87czifq0sn.fsf@mbork.pl> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:228786 Archived-At: On 21.03.2022 08:26, Marcin Borkowski wrote: > Interesting - I thought using spaces for indentation is a no-no nowadays > (at least in JS, Lisp is another thing, for obvious reasons). But I may > be mistaken, and I don't think tabs are inherently better - though we do > use them in our company. There are a bunch of odd styles in use in JS. For example, comma-first indentation, where you don't put commas at the end of a line, and instead add newline and indentation before them. But space-based indentation still seems prevalent. Anyway... >> This indentation feature was ported from js2-mode at some point, where >> it is guarded by the (on by default) user option >> js2-pretty-multiline-declarations. The option itself was lost in >> transition. >> >> See js2-old-indent.el for more info. > > Very interesting. FWIW, I almost never have many variables in a single > let/const - I prefer to write > > let a = 1; > let b = 2; > const c = 3; > const d = 4; > > (and this also is a style I learned where I work). At some point support for multi-var combined declarations was requested for, that's when I added that var. So, the code is out there, it shouldn't be hard to adapt to js-mode, if you have the time.