From: Dmitry Gutov <dgutov@yandex.ru>
To: Marcin Borkowski <mbork@mbork.pl>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, 40760@debbugs.gnu.org
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 [thread overview]
Message-ID: <77d4627a-8e73-ce5c-c027-01813cbedbb9@yandex.ru> (raw)
In-Reply-To: <87czifq0sn.fsf@mbork.pl>
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.
prev parent reply other threads:[~2022-03-23 0:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-22 9:05 bug#40760: 27.0.50; An indentation problem with const and chaining in js-mode Marcin Borkowski
2022-03-14 5:10 ` Marcin Borkowski
2022-03-14 9:40 ` Lars Ingebrigtsen
2022-03-14 10:13 ` Marcin Borkowski
2022-03-18 1:12 ` Dmitry Gutov
2022-03-21 6:26 ` Marcin Borkowski
2022-03-23 0:46 ` Dmitry Gutov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=77d4627a-8e73-ce5c-c027-01813cbedbb9@yandex.ru \
--to=dgutov@yandex.ru \
--cc=40760@debbugs.gnu.org \
--cc=larsi@gnus.org \
--cc=mbork@mbork.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).