GNU bug report logs - #25904
Formatting bug with js-mode

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: Michael Snead <aikeru@HIDDEN>; Done: Dmitry Gutov <dgutov@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 25904-done <at> debbugs.gnu.org:


Received: (at 25904-done) by debbugs.gnu.org; 13 Feb 2019 00:27:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 12 19:27:36 2019
Received: from localhost ([127.0.0.1]:45590 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gtiOm-0007L8-7I
	for submit <at> debbugs.gnu.org; Tue, 12 Feb 2019 19:27:36 -0500
Received: from mail-lf1-f46.google.com ([209.85.167.46]:36615)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1gtiOk-0007Kw-VH
 for 25904-done <at> debbugs.gnu.org; Tue, 12 Feb 2019 19:27:35 -0500
Received: by mail-lf1-f46.google.com with SMTP id q11so427814lfd.3
 for <25904-done <at> debbugs.gnu.org>; Tue, 12 Feb 2019 16:27:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=I+qUaSx34wWYruP957RwuHD8EF9IFmoZSs3/9I267Bc=;
 b=AqQu43OnNVHel0sY9+Jfu1WCknNa+en7saMy06rbHCCJGAcYh80SHHbO29LJ1twazC
 lYxoxf412N/0ZqTWAKTkVNZiTtDOI5xl3LDJiqlU7cpDOldlGtr2GyNbd+3XCTksS5Z7
 Gvfqc4wa9asGGRFKlLFlJgDB9Pf+YvBXRibLE2gmjTvI1wbggS98dSdfSk9jPBjGA1hi
 vtkEoSLw5A7L1cGUtvNhBVlLT49jq7bywIWbFJMOsZW/4nru4vBeqlIEdqiCDUjVV7jB
 FSte5XAC1PZNmoDj6f0f5rgqaSQkZ2X51gaHNFs5/Zmgo0Lh1D+VJ06CrjGpirRw1/Df
 YZSg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=I+qUaSx34wWYruP957RwuHD8EF9IFmoZSs3/9I267Bc=;
 b=D+PuWOu0SOPcnQg+1ziCUlA6+YXJfOKQ1BIEGgpcsEIDTIYWzMOVsB4wlIHoqtb77v
 9l3k43PkKrzjoStJRVkVLx3AbT2k6t1YjMDi4gRnLdA7OBFL2OpMqIrWj0wpFyfff779
 uoCO8pkGcaVph6Ha1b3fBRidkJ2leyEbKaP5v64LjEBm9axNmxKXyuZBwY1epLWCpyBl
 Q4d08LwYoFepGEFqtFoTeOG+tj1BDpumiK+GBwJke7fLVGsuZ5DRBD3WWbLvBhMGcMyK
 2yMU/zEWQqLTwRdnnJ/+dmn+ljp1ZxiX50/+QjqnxYxRk5Z9kk+6AnlIV4RmI6XECQkh
 oDkw==
X-Gm-Message-State: AHQUAuYrsE1a8gRGGbjlvzS+/QFgoenYrHjcZ3eFgOER8iZqpPIi0gM9
 Aleh/+lBCAvj6w1sy/Yislgi5ehA
X-Google-Smtp-Source: AHgI3IaHKPOpwFVlsdkKxmh5BN5Cw+ZHCL488lAZodhwY6FCi1EGQvB1KmYtdvx742k1DY/dVssFWA==
X-Received: by 2002:ac2:43aa:: with SMTP id t10mr66730lfl.107.1550017648574;
 Tue, 12 Feb 2019 16:27:28 -0800 (PST)
Received: from [192.168.1.174] ([178.252.127.239])
 by smtp.googlemail.com with ESMTPSA id l27sm2706243lfk.6.2019.02.12.16.27.26
 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128);
 Tue, 12 Feb 2019 16:27:27 -0800 (PST)
Subject: Re: bug#25904: Patches
To: Jackson Ray Hamilton <jackson@HIDDEN>,
 25904-done <at> debbugs.gnu.org
References: <CAEtRwfCeH8yeiaCc+wF3mRtvVh3F0PTi7G5HvjSrzBuH_EQrMw@HIDDEN>
 <1195338258.64458.1549836224184@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <0f6ddb11-113f-e302-7c2e-bbe9494c0d79@HIDDEN>
Date: Wed, 13 Feb 2019 03:27:26 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101
 Thunderbird/65.0
MIME-Version: 1.0
In-Reply-To: <1195338258.64458.1549836224184@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Spam-Score: 1.5 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  Version: 27.1 On 11.02.2019 01:03, Jackson Ray Hamilton wrote:
    > Both changes are attached.  They could be applied to the emacs-26 > branch. 
    (Or master, but emacs-26 would be preferable so we can deliver > it sooner. 
    I tested on both branches.) 
 
 Content analysis details:   (1.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  1.5 RCVD_IN_SORBS_WEB      RBL: SORBS: sender is an abusable web server
                             [178.252.127.239 listed in dnsbl.sorbs.net]
  0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
                             mail domains are different
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/,
                             no trust
                             [209.85.167.46 listed in list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (dgutov[at]yandex.ru)
  0.0 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
                             EnvelopeFrom freemail headers are
                             different
X-Debbugs-Envelope-To: 25904-done
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.5 (/)

Version: 27.1

On 11.02.2019 01:03, Jackson Ray Hamilton wrote:

> Both changes are attached.  They could be applied to the emacs-26 
> branch.  (Or master, but emacs-26 would be preferable so we can deliver 
> it sooner.  I tested on both branches.)

Pushed to master, thank you.

Regarding emacs-26, please feel free to lobby it with Eli. I think it's 
a fine patch, but I'm not sure it's important enough regression-wise.




Notification sent to Michael Snead <aikeru@HIDDEN>:
bug acknowledged by developer. Full text available.
Reply sent to Dmitry Gutov <dgutov@HIDDEN>:
You have taken responsibility. Full text available.

Message received at 25904 <at> debbugs.gnu.org:


Received: (at 25904) by debbugs.gnu.org; 10 Feb 2019 22:03:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 10 17:03:52 2019
Received: from localhost ([127.0.0.1]:42902 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gsxCa-0000f2-9K
	for submit <at> debbugs.gnu.org; Sun, 10 Feb 2019 17:03:52 -0500
Received: from mta-06-3.privateemail.com ([198.54.127.59]:12952)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jackson@HIDDEN>) id 1gsxCY-0000eo-7p
 for 25904 <at> debbugs.gnu.org; Sun, 10 Feb 2019 17:03:51 -0500
Received: from MTA-06.privateemail.com (localhost [127.0.0.1])
 by MTA-06.privateemail.com (Postfix) with ESMTP id 4813E6003D
 for <25904 <at> debbugs.gnu.org>; Sun, 10 Feb 2019 17:03:44 -0500 (EST)
Received: from APP-06 (unknown [10.20.147.156])
 by MTA-06.privateemail.com (Postfix) with ESMTPA id 31D1560039
 for <25904 <at> debbugs.gnu.org>; Sun, 10 Feb 2019 22:03:44 +0000 (UTC)
Date: Sun, 10 Feb 2019 14:03:44 -0800 (PST)
From: Jackson Ray Hamilton <jackson@HIDDEN>
To: 25904 <at> debbugs.gnu.org
Message-ID: <1195338258.64458.1549836224184@HIDDEN>
Subject: Patches
MIME-Version: 1.0
Content-Type: multipart/mixed; 
 boundary="----=_Part_64456_814158368.1549836224176"
X-Priority: 3
Importance: Medium
X-Mailer: Open-Xchange Mailer v7.8.1-Rev36
X-Originating-Client: open-xchange-appsuite
X-Virus-Scanned: ClamAV using ClamSMTP
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 25904
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Jackson Ray Hamilton <jackson@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

------=_Part_64456_814158368.1549836224176
Content-Type: multipart/alternative; 
	boundary="----=_Part_64457_797999058.1549836224176"

------=_Part_64457_797999058.1549836224176
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hello Dmitry and Felipe,

I=E2=80=99ve taken a stab at formatting Felipe=E2=80=99s fix for arrow func=
tion indentation according to the coding standards.  Compared to his patch,=
 I made some trivial name/doc changes, and changed

(progn (forward-char) (js--looking-at-broken-arrow-function-p))

to

(save-excursion (forward-char) (js--looking-at-broken-arrow-function-p))

since we probably want to undo the forward-char in case the form returns ni=
l.

In order to get all the JS indentation tests to pass with make, I also had =
to make a variable safe file-locally.

Both changes are attached.  They could be applied to the emacs-26 branch.  =
(Or master, but emacs-26 would be preferable so we can deliver it sooner.  =
I tested on both branches.)

Jackson

------=_Part_64457_797999058.1549836224176
MIME-Version: 1.0
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit

<!DOCTYPE html>
<html><head>
    <meta charset="UTF-8">
</head><body><p>Hello Dmitry and Felipe,<br></p><p>I&#8217;ve taken a stab at formatting Felipe&#8217;s fix for arrow function indentation according to the coding standards.&#160; Compared to his patch, I made some trivial name/doc changes, and changed<br></p><p><code>(progn (forward-char) (js--looking-at-broken-arrow-function-p))</code></p><p>to<br></p><p><code>(save-excursion (forward-char) (js--looking-at-broken-arrow-function-p))</code></p><p>since we probably want to undo the forward-char in case the form returns nil.<br></p><p>In order to get all the JS indentation tests to pass with make, I also had to make a variable safe file-locally.<br></p><p>Both changes are attached.&#160; They could be applied to the emacs-26 branch.&#160; (Or master, but emacs-26 would be preferable so we can deliver it sooner.&#160; I tested on both branches.)<br></p><p>Jackson<br></p></body></html>
 
------=_Part_64457_797999058.1549836224176--

------=_Part_64456_814158368.1549836224176
Content-Type: text/x-patch; charset=UTF-8;
 name=0001-Indent-arrows-expression-bodies-like-function-bodies.patch
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename=0001-Indent-arrows-expression-bodies-like-function-bodies.patch
X-Part-Id: 90a2d78cfa684e7daf7dd29a91ec56bf

RnJvbSAzODNhNmFhMTNmOTAzNDZiNDg5YmM0YjhmOTAwZmU3NjdhNzI1YjkwIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBKYWNrc29uIFJheSBIYW1pbHRvbiA8amFja3NvbkBqYWNrc29u
cmF5aGFtaWx0b24uY29tPgpEYXRlOiBTYXQsIDkgRmViIDIwMTkgMTI6MjY6MjEgLTA4MDAKU3Vi
amVjdDogW1BBVENIXSA9P1VURi04P3E/SW5kZW50PTIwYXJyb3dzPUUyPTgwPTk5PTIwZXhwcmVz
c2lvbj0yMGJvZGllcz89CiA9P1VURi04P3E/PTIwbGlrZT0yMGZ1bmN0aW9uPTIwYm9kaWVzPTIw
KEJ1ZyMyNTkwNCk/PQpNSU1FLVZlcnNpb246IDEuMApDb250ZW50LVR5cGU6IHRleHQvcGxhaW47
IGNoYXJzZXQ9VVRGLTgKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogOGJpdAoKKiBsaXNwL3By
b2dtb2Rlcy9qcy5lbCAoanMtLWNvbnRpbnVlZC1leHByZXNzaW9uLXApOiBEb27igJl0IGNvbmZ1
c2UK4oCYPT7igJkgZm9yIGEg4oCYPuKAmSBvcGVyYXRvci4KKGpzLS1saW5lLXRlcm1pbmF0aW5n
LWFycm93LXJlKTogTmV3IHZhcmlhYmxlLgooanMtLWxvb2tpbmctYXQtYnJva2VuLWFycm93LWZ1
bmN0aW9uLXApOiBOZXcgZnVuY3Rpb24uCihqcy0tcHJvcGVyLWluZGVudGF0aW9uKTogRG9u4oCZ
dCBhbGlnbiBhcnJvdyBm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2UgdG9rZW4g
b2YgdGhlCitjdXJyZW50IGxpbmUgaXMgdGhlIFwiPT5cIiB0b2tlbi4iCisgICh3aGVuIChsb29r
aW5nLWF0ICJcXHMtKmFzeW5jXFxzLSoiKQorICAgIChnb3RvLWNoYXIgKG1hdGNoLWVuZCAwKSkp
CisgIChjb25kCisgICAoKGVxIChjaGFyLWFmdGVyKSA/XCgpCisgICAgKGZvcndhcmQtbGlzdCkK
KyAgICAobG9va2luZy1hdC1wIGpzLS1saW5lLXRlcm1pbmF0aW5nLWFycm93LXJlKSkKKyAgICh0
IChsb29raW5nLWF0LXAKKyAgICAgICAoY29uY2F0IGpzLS1uYW1lLXJlIGpzLS1saW5lLXRlcm1p
bmF0aW5nLWFycm93LXJlKSkpKSkKKwogKGRlZnVuIGpzLS1wcm9wZXItaW5kZW50YXRpb24gKHBh
cnNlLXN0YXR1cykKICAgIlJldHVybiB0aGUgcHJvcGVyIGluZGVudGF0aW9uIGZvciB0aGUgY3Vy
cmVudCBsaW5lLiIKICAgKHNhdmUtZXhjdXJzaW9uCkBAIC0yMTA4LDcgKzIxMjYsOCBAQCBqcy0t
cHJvcGVyLWluZGVudGF0aW9uCiAgICAgICAgICAgICAgICAgIChjb250aW51ZWQtZXhwci1wIChq
cy0tY29udGludWVkLWV4cHJlc3Npb24tcCkpKQogICAgICAgICAgICAgIChnb3RvLWNoYXIgKG50
aCAxIHBhcnNlLXN0YXR1cykpIDsgZ28gdG8gdGhlIG9wZW5pbmcgY2hhcgogICAgICAgICAgICAg
IChpZiAob3IgKG5vdCBqcy1pbmRlbnQtYWxpZ24tbGlzdC1jb250aW51YXRpb24pCi0gICAgICAg
ICAgICAgICAgICAgICAobG9va2luZy1hdCAiWyh7W11cXHMtKlxcKC9bLypdXFx8JFxcKSIpKQor
ICAgICAgICAgICAgICAgICAgICAgKGxvb2tpbmctYXQgIlsoe1tdXFxzLSpcXCgvWy8qXVxcfCRc
XCkiKQorICAgICAgICAgICAgICAgICAgICAgKHNhdmUtZXhjdXJzaW9uIChmb3J3YXJkLWNoYXIp
IChqcy0tbG9va2luZy1hdC1icm9rZW4tYXJyb3ctZnVuY3Rpb24tcCkpKQogICAgICAgICAgICAg
ICAgICAocHJvZ24gOyBub3RoaW5nIGZvbGxvd2luZyB0aGUgb3BlbmluZyBwYXJlbi9icmFja2V0
CiAgICAgICAgICAgICAgICAgICAgKHNraXAtc3ludGF4LWJhY2t3YXJkICIgIikKICAgICAgICAg
ICAgICAgICAgICAod2hlbiAoZXEgKGNoYXItYmVmb3JlKSA/XCkpIChiYWNrd2FyZC1saXN0KSkK
ZGlmZiAtLWdpdCBhL3Rlc3QvbWFudWFsL2luZGVudC9qcy5qcyBiL3Rlc3QvbWFudWFsL2luZGVu
dC9qcy5qcwppbmRleCBiMGQ4YmNhYmQyLi5mYzM5YzEyMjQ0IDEwMDY0NAotLS0gYS90ZXN0L21h
bnVhbC9pbmRlbnQvanMuanMKKysrIGIvdGVzdC9tYW51YWwvaW5kZW50L2pzLmpzCkBAIC0xNDQs
NiArMTQ0LDE1IEBAIGJhcigKICAgL2FiYy8KICkKIAorLy8gYnVnIzI1OTA0Citmb28uYmFyLmJh
eih2ZXJ5ID0+IC8vIEEgY29tbWVudAorICB2ZXJ5CispLmJpeigoW2Jhej17YTogWzEyM119LCBi
b3pdKSA9PgorICBiYXoKKykuc25hcmYoKHNub3JmKSA9PiAvKiBBbm90aGVyIGNvbW1lbnQgKi8K
KyAgc25vcmYKKyk7CisKIC8vIExvY2FsIFZhcmlhYmxlczoKIC8vIGluZGVudC10YWJzLW1vZGU6
IG5pbAogLy8ganMtaW5kZW50LWxldmVsOiAyCi0tIAoyLjExLjAKCg==
------=_Part_64456_814158368.1549836224176
Content-Type: text/x-patch; charset=ISO-8859-1;
 name=0001-js-indent-align-list-continuation-Make-variable-safe.patch
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename=0001-js-indent-align-list-continuation-Make-variable-safe.patch
X-Part-Id: 9b9ff441bad1427a807d5d47e07daff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
OnNhZmUgJ2Jvb2xlYW5wCiAgIDpncm91cCAnanMpCiAKIChkZWZjdXN0b20ganMtY29tbWVudC1s
aW5ldXAtZnVuYyAjJ2MtbGluZXVwLUMtY29tbWVudHMKLS0gCjIuMTEuMAoK
------=_Part_64456_814158368.1549836224176--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#25904; Package emacs. Full text available.

Message received at 25904 <at> debbugs.gnu.org:


Received: (at 25904) by debbugs.gnu.org; 4 May 2018 21:37:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 04 17:37:25 2018
Received: from localhost ([127.0.0.1]:50009 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fEiOL-0006qB-KM
	for submit <at> debbugs.gnu.org; Fri, 04 May 2018 17:37:25 -0400
Received: from mail-wr0-f176.google.com ([209.85.128.176]:43184)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1fEiOJ-0006py-RR
 for 25904 <at> debbugs.gnu.org; Fri, 04 May 2018 17:37:24 -0400
Received: by mail-wr0-f176.google.com with SMTP id v15-v6so22386861wrm.10
 for <25904 <at> debbugs.gnu.org>; Fri, 04 May 2018 14:37:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=qeqLsDZ0DFXNNRxDjuU+WQLFhuEqdWLXbkz5w/lTBKg=;
 b=GSTl91Zx9lAFfLL2BlytsFdmi9qyT91r+0pBsTClClCE0ES1SVnvOaje5EZKxrDbWp
 ke1Y4rW163X0XqinkhlXlPkYwkoL+V8kYLkht9vYYzf/GWFhnpZ+0aYggKvX/572eMzP
 ObnCPVj+2w5PG5pIPUKI/ViTNclqoTbG//95FxRVy7t5e4dg/enXMiW9oJ6DTP/vHk5Z
 f5w5BfK2/pl/w2fc8YNbRmPJtJXNjUE8BMH6McjGMy2O6771KRPRkx84QyKZBOykucOL
 ClW+jMN32JSXtVLpexXTIwEvrkxJqPZV6W7jTDEfAzEZFCPxPOkdb7uROGEXJMY1ExgU
 nlXQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=qeqLsDZ0DFXNNRxDjuU+WQLFhuEqdWLXbkz5w/lTBKg=;
 b=fPjDP7IXseGAZyxlr/IjX/UO22yOTSY451RBFa504nB55q99dYY/EAWFYe3Cika6xL
 s6Tof04bN+hlksqn/rvD83TNVF7Y8GsEzAzlM1pMjd3bBRZBvmybccAxDnFAuicw/OL7
 05FQRByoGvwJkfI5cGJxLnLXiaMzaBv1Ba7Zb0P4dJilsLadGctiyv1MfXAnnIacmw6H
 H3SUaeoyPPPpYPXWfbSn9nZrj/qRSjxzvEP4wVwtB/Qe9sND8SmFloZQkDpp0AV3z50Q
 iyL5vNoxcveMeAK0pM9+4WOgVKPzgnctbDmSzvv6TrxTW/VlmHzD9k3WC6TzY5MtPM6B
 zgpA==
X-Gm-Message-State: ALQs6tDrjK2w/EdDPOHecbsNW+8I6+olUbwL6D01UwFHYQ/IGfpBtV29
 nM74XmX1W6GV+14upB/+gj4tqroN
X-Google-Smtp-Source: AB8JxZpnz97QJgpOw8PW0kIMCQ3qlRLm//C1dQF7JsmCm7dUQIcQiz4N/3LE+L0fVy0ARzWBoJY3Dw==
X-Received: by 2002:adf:b2f5:: with SMTP id
 g108-v6mr24314240wrd.147.1525469837755; 
 Fri, 04 May 2018 14:37:17 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id
 b18-v6sm27200638wrb.55.2018.05.04.14.37.15
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 04 May 2018 14:37:16 -0700 (PDT)
Subject: Re: bug#25904: Formatting bug with js-mode
To: Felipe Ochoa <felipe.nospam.ochoa@HIDDEN>
References: <CAEtRwfCeH8yeiaCc+wF3mRtvVh3F0PTi7G5HvjSrzBuH_EQrMw@HIDDEN>
 <87shdp63vk.fsf@HIDDEN> <7f9fd974-e768-b532-ad86-33adb531d189@HIDDEN>
 <87y3n0mvzd.fsf@HIDDEN> <ffa9276c-f384-45d4-f806-6d4b53093a15@HIDDEN>
 <CAJEr+DMTBjtMXOUUf6uT9dtye2TwHUgqnJ120t4TehWXo6FyXg@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <a3690d0c-d20e-8800-f35a-41397bc526a7@HIDDEN>
Date: Sat, 5 May 2018 00:37:13 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.0
MIME-Version: 1.0
In-Reply-To: <CAJEr+DMTBjtMXOUUf6uT9dtye2TwHUgqnJ120t4TehWXo6FyXg@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 25904
Cc: 25904 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

On 3/16/18 3:06 AM, Felipe Ochoa wrote:
> This has taken a *little* longer than I'd hoped, but here's a new
> patch with all the discussed changes. Hopefully I got the commit
> message formatting and content right

Not really. First of all, I asked for an attached file ('git am' needs a 
file), and not its contents inside the message body. Which suffered 
word-wrap damage during transmission (because that's what email clients do).

I would commit it this time anyway, though, if not for the next point.

>  From 0c7eed3fd9f7f77a071296c191e8569471bac4e5 Mon Sep 17 00:00:00 2001
> From: Felipe Ochoa <felipe.nospam.ochoa@HIDDEN>
> Date: Tue, 7 Nov 2017 16:50:42 -0500
> Subject: [PATCH] Fixes js indentation after arrow function without parens
> 
> From: felipe <felipe@HIDDEN>
> 
> * lisp/progmodes/js.el (js--proper-indentation)
> (js--looking-at-broken-arrow-function-p)

I think there was going to be some description here.

And there's no mention of changes to js--continued-expression-p and 
js--proper-indentation. They would have the meat of the explanation.

> * test/manual/indent/js.js: Indent expression following an arrow as
> though it were enclosed in parentheses

This needs a period, at least.

> (Bug#25904)

We usually put the bug number inside one of the sentences of the change 
log entry, not just at the end of it.

The patch does work, but if you could make the details right, it would 
be great. We've missed the emacs-26 train, so there's no real hurry.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#25904; Package emacs. Full text available.

Message received at 25904 <at> debbugs.gnu.org:


Received: (at 25904) by debbugs.gnu.org; 29 Apr 2018 02:43:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 28 22:43:38 2018
Received: from localhost ([127.0.0.1]:42430 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fCcJO-0004qW-Kn
	for submit <at> debbugs.gnu.org; Sat, 28 Apr 2018 22:43:38 -0400
Received: from eggs.gnu.org ([208.118.235.92]:35697)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1fCcJM-0004qI-Ml
 for 25904 <at> debbugs.gnu.org; Sat, 28 Apr 2018 22:43:37 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1fCcJG-0007Pz-MJ
 for 25904 <at> debbugs.gnu.org; Sat, 28 Apr 2018 22:43:31 -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 autolearn=disabled
 version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60548)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1fCcJ8-0007Mk-F4; Sat, 28 Apr 2018 22:43:22 -0400
Received: from [176.228.60.248] (port=3993 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1fCcJ7-0004Cg-Sy; Sat, 28 Apr 2018 22:43:22 -0400
Date: Sun, 29 Apr 2018 05:43:06 +0300
Message-Id: <83604au405.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Jimmy Yuen Ho Wong <wyuenho@HIDDEN>
In-reply-to: <bb6707cc-3f30-b38a-881a-79a41eee7a85@HIDDEN> (message from
 Jimmy Yuen Ho Wong on Sun, 29 Apr 2018 02:20:39 +0100)
Subject: Re: bug#25904: bug#24896: JSX prop indentation after fat arrow
References: <CAEtRwfCeH8yeiaCc+wF3mRtvVh3F0PTi7G5HvjSrzBuH_EQrMw@HIDDEN>
 <bb6707cc-3f30-b38a-881a-79a41eee7a85@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 25904
Cc: 25904 <at> debbugs.gnu.org, felipe.nospam.ochoa@HIDDEN, dgutov@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

> From: Jimmy Yuen Ho Wong <wyuenho@HIDDEN>
> Date: Sun, 29 Apr 2018 02:20:39 +0100
> Cc: Felipe Ochoa <felipe.nospam.ochoa@HIDDEN>,
> 	Dmitry Gutov <dgutov@HIDDEN>
> 
> If this patch works, can we make it into Emacs 26 before the release?

No, it's too late for that.  Sorry.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#25904; Package emacs. Full text available.

Message received at 25904 <at> debbugs.gnu.org:


Received: (at 25904) by debbugs.gnu.org; 29 Apr 2018 01:20:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 28 21:20:49 2018
Received: from localhost ([127.0.0.1]:42409 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fCb1E-0002wg-Sm
	for submit <at> debbugs.gnu.org; Sat, 28 Apr 2018 21:20:49 -0400
Received: from mail-wr0-f173.google.com ([209.85.128.173]:39030)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <wyuenho@HIDDEN>) id 1fCb1D-0002wU-Eo
 for 25904 <at> debbugs.gnu.org; Sat, 28 Apr 2018 21:20:47 -0400
Received: by mail-wr0-f173.google.com with SMTP id q3-v6so4962397wrj.6
 for <25904 <at> debbugs.gnu.org>; Sat, 28 Apr 2018 18:20:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=to:cc:from:subject:openpgp:autocrypt:message-id:date:user-agent
 :mime-version:content-transfer-encoding:content-language;
 bh=uVBxUg+c1oofk5JDfUsarsP6kuSd7+OUgYZ27ldPMlU=;
 b=TlNATKjZbQ4vudcNvsNmkXTAuwyO3oxfCkFcpddImN5auFt7P6Pk3Uw8n4utPMQ9Ve
 9PrycX/oPk5/CVf0WHWS31sWaG933h3oDdskmkG7ZnoyIvGHd0aqk4cm4MXjTDYe2JpS
 mfTTYD1XQbJzAUjt6LMf3LZ4IB+5gljBYMS2/0gz/qKQihXRZHKYf1WHNajuyDET8fTn
 LH5QDykdrRSLlpWPX/qR16EgToFxWbVVqvZNZTdaXH/0UMv3ZTmnN/qZJEoRHdaYsO9D
 l3rCY31p+I5v4tmsWJTBZ4NutsgRLCnB7DI47gzqyiuAKHyiyYhxG0nk/YdxMNVYOnuC
 hwlA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:to:cc:from:subject:openpgp:autocrypt:message-id
 :date:user-agent:mime-version:content-transfer-encoding
 :content-language;
 bh=uVBxUg+c1oofk5JDfUsarsP6kuSd7+OUgYZ27ldPMlU=;
 b=G2kmBNQBmeBlwp3G4j5yL88NuKzVGTCwncTXeFZNa4dV8neE79XEJIFQXY55hle4P9
 cspuwjbsW1XkZ3n/4P4+5g+VBZppHmttXZt+0so1k309oy9Ytf769UpAOpVAJEGZjiJw
 hXk8BEtHw3Fx4ia15OVBEh6Ca4cw1YupLqiGVaOc2H+pZGP3MBKuPA4ZpsTwhqJyTdvh
 +vVLva1ezMbRuRNYTGIis52s4wnICoW68jegACEs405XfatoxaLu80eVC2SABVTYvccc
 EpoURnfbeSFVM0iIbwBRABAQSBJwFGcV59bifXxsj486hFuCGQT/kwN5kLnNjjjrRa32
 tVcA==
X-Gm-Message-State: ALQs6tCXr7SQSmDqc06MhgqykSEvVKWqmisaH0IbQJDLlvvuE11Uqpo8
 irVmhh+HhlmVNUB9Njk2eMY=
X-Google-Smtp-Source: AB8JxZrE8gIzMPuO21kntqGrFYNI7Lc79e87uZ9Grcv/kn40we1cSUo+ULtGUo85OlURjIa6K1PExw==
X-Received: by 2002:adf:87ab:: with SMTP id
 b40-v6mr5676692wrb.156.1524964841669; 
 Sat, 28 Apr 2018 18:20:41 -0700 (PDT)
Received: from MobileCat.local ([88.98.208.53])
 by smtp.gmail.com with ESMTPSA id b18-v6sm8135208wrb.55.2018.04.28.18.20.40
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 28 Apr 2018 18:20:40 -0700 (PDT)
To: 25904 <at> debbugs.gnu.org
From: Jimmy Yuen Ho Wong <wyuenho@HIDDEN>
Subject: Re: bug#24896: JSX prop indentation after fat arrow
Openpgp: preference=signencrypt
Autocrypt: addr=wyuenho@HIDDEN; prefer-encrypt=mutual; keydata=
 xsFNBFrSFY8BEADPCwJ+z3krWkYRMNlw3UkxtYlj3v5fuPzjxvpzegH7x0breoiF782EY1j6
 Xr3U3yV6WKBRVNgCkF6xibSl1BXFYQMw+k/27OGr/v+7NB+HOORAKxMvYeepR9nMpQuIB5+4
 BT2Jyk2bmnpS27eXscDFlS4KmUPztg1odVGlMwe0ltrNgmEb5AZ7OSGw9doq4KfwBLJ0K+YQ
 Se0LltI8DP/TTNgl/srmWxWER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RAnMIcQEcWsL3+AD/4i5dBMnj5V2SkrkTn/Gho1/tz/zXzx0lxe
 +y+NWQZ8dbBUmFhWU1xK+kU49oOpozx6iu1EzPYke/YKYBcR7g858HxC5BlrUVxZxdIX+anm
 vD3eU1nkOYM6U5TMqHtc//KK+ZoXkN7uLsYkkRPQjQ9hrTFX5RpkHI+6ilKJ+9uUBDUWPQGd
 y5YimlI6BJn1TzAGixfEytYNRIe6InB2ce/ptFQHc83TrcML2Y1gL0E2SieHw6vv07WfrNK2
 /tV4N/lA97IT/xZLZ9bRkzoTSJz6QOrdyGdhqXDkw2ghYNKM3+3YU5SBfoqoaBYvzoAdw5KE
 B8qUHrHe3qmjee8xgZ4wH8acOnxNCo9cZVNUH1otGOwPREYbSYGkd93kFlUkyHbtFtCx1Cl4
 ODqZ0sAEmP6dR5Zc2kNTKWX+1ZsCFHO8Z7NLgmshg2BcB+fqDefHJ9JU47BEWSZW3rRYkr42
 KivMs8eFO8YoYwnOIrg4mf5hWgfPo8Rh9FicpN6PiVv8B1ojOsQ4OTDb+58iEjCe/LbRAIBC
 LnIcIbx2kSS+d2DCNk5+e9SKhi3SoZVRtvFzXQO7dJhkeGevkWGxrBT5OpvPtxfwFPOUbG8y
 9gBiJ7VntqfR4FtXQ+OQF5yz05EAEsxevsDLw8np5W6ZBA79mHkOADOGi0TRP9QrOJnFFirV ig==
Message-ID: <bb6707cc-3f30-b38a-881a-79a41eee7a85@HIDDEN>
Date: Sun, 29 Apr 2018 02:20:39 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0)
 Gecko/20100101 Thunderbird/52.7.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Content-Language: en-GB
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 25904
Cc: Felipe Ochoa <felipe.nospam.ochoa@HIDDEN>,
 Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

If this patch works, can we make it into Emacs 26 before the release?

Thanks a lot for working on this. This has been the most annoying bug in
js-mode.






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#25904; Package emacs. Full text available.

Message received at 25904 <at> debbugs.gnu.org:


Received: (at 25904) by debbugs.gnu.org; 16 Mar 2018 01:07:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 15 21:07:45 2018
Received: from localhost ([127.0.0.1]:35558 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ewdqT-00017y-2F
	for submit <at> debbugs.gnu.org; Thu, 15 Mar 2018 21:07:45 -0400
Received: from mail-ot0-f182.google.com ([74.125.82.182]:39774)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <felipeochoa0918@HIDDEN>) id 1ewdqR-00017l-O6
 for 25904 <at> debbugs.gnu.org; Thu, 15 Mar 2018 21:07:44 -0400
Received: by mail-ot0-f182.google.com with SMTP id h8-v6so8821208oti.6
 for <25904 <at> debbugs.gnu.org>; Thu, 15 Mar 2018 18:07:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:sender:in-reply-to:references:from:date:message-id
 :subject:to:cc;
 bh=RAmUm5XiGkuiDQHCuqcy2hB4q6zHDjTaxBVtaKBkfK4=;
 b=UAwTMPL7Tv+L+7mtwZBOjdl7UgTidJUVTVgLyi4m5FVtNWoL2X2yq1EBsMWNzNYffm
 RjS07LppKA09eVHUa6DKA7G9SarZdxjosL+8Rd61hGb8p/qZWWPyZpq1BNvKU08ZwWbn
 9SgW9co5tjru0itAhzdKr/RMWDgalkjAP2g1ySf4FwrDHhKiMEk0OfqzCLwQAi0Fpr52
 y3UIKOwvouGa6EDTztrEo6MecVyGW+tkOSMCq603Zy5KzdjpQegvA5tppzcxL2pbp3NR
 KdAd9NQe8FjZEDXy6zpp7FbZFnCd2YMOdMdxTy7UWiGoKHc5GWBfnNnH+lKMrctALWVP
 93yw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
 :date:message-id:subject:to:cc;
 bh=RAmUm5XiGkuiDQHCuqcy2hB4q6zHDjTaxBVtaKBkfK4=;
 b=KQbfV7qLzQBRJAi4TOyU5JBazBJxOzHefCZNrSOkmlxrF4F6lqjQJLiLNMZYZjx2hB
 eM9k7G5qF1aLgWHB40Yy/elXVe0YGzNNwabpLDey7DzdAFexIYBbcBAtlv9JM3rvg6/c
 jP2nnWzG7ljM8zhxUQQwdpQHwytEKVmpOzXbu+ep97i1m4J8DbG5TjJV8JLKA4nV5XB4
 /i+cQmdB3sIdPITedkHYMwVRJHllpt/Sle2sjh4bh/PzL93n0cea+92A1AVX0K89o5CS
 kBurLsbY50V0ZOC+VsGyKq2/gcOQ26TD56OtV34OCqCWljkWf30Miy/riLX8i/opoBLf
 vAeg==
X-Gm-Message-State: AElRT7Ff3YhvI099DyAubWvPKTkNPIdvLxnY2qu1N38pKSWIBnicu5/j
 8peWji9MqFGBXaoIJpotP54BtMeUqHfL3WsAwqg=
X-Google-Smtp-Source: AG47ELsvY1ztzch7KwD/lnjUzspipz9FilWX6/vh5yBtnyE08FrLkR15+egOZqqwOnbfJy39CFJ/nvHuA7RdC+vqNc0=
X-Received: by 10.157.76.133 with SMTP id m5mr6651388otf.179.1521162458039;
 Thu, 15 Mar 2018 18:07:38 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.74.97.93 with HTTP; Thu, 15 Mar 2018 18:06:57 -0700 (PDT)
In-Reply-To: <ffa9276c-f384-45d4-f806-6d4b53093a15@HIDDEN>
References: <CAEtRwfCeH8yeiaCc+wF3mRtvVh3F0PTi7G5HvjSrzBuH_EQrMw@HIDDEN>
 <87shdp63vk.fsf@HIDDEN> <7f9fd974-e768-b532-ad86-33adb531d189@HIDDEN>
 <87y3n0mvzd.fsf@HIDDEN> <ffa9276c-f384-45d4-f806-6d4b53093a15@HIDDEN>
From: Felipe Ochoa <felipe.nospam.ochoa@HIDDEN>
Date: Thu, 15 Mar 2018 20:06:57 -0500
X-Google-Sender-Auth: -FA29TTvOiZcU-UDVMWSxccTLus
Message-ID: <CAJEr+DMTBjtMXOUUf6uT9dtye2TwHUgqnJ120t4TehWXo6FyXg@HIDDEN>
Subject: Re: bug#25904: Formatting bug with js-mode
To: Dmitry Gutov <dgutov@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 25904
Cc: 25904 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.2 (/)

This has taken a *little* longer than I'd hoped, but here's a new
patch with all the discussed changes. Hopefully I got the commit
message formatting and content right

From 0c7eed3fd9f7f77a071296c191e8569471bac4e5 Mon Sep 17 00:00:00 2001
From: Felipe Ochoa <felipe.nospam.ochoa@HIDDEN>
Date: Tue, 7 Nov 2017 16:50:42 -0500
Subject: [PATCH] Fixes js indentation after arrow function without parens

From: felipe <felipe@HIDDEN>

* lisp/progmodes/js.el (js--proper-indentation)
(js--looking-at-broken-arrow-function-p)
* test/manual/indent/js.js: Indent expression following an arrow as
though it were enclosed in parentheses

(Bug#25904)
---
 lisp/progmodes/js.el     | 24 ++++++++++++++++++++++--
 test/manual/indent/js.js |  9 +++++++++
 2 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index f30e591..5a333a9 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -1849,7 +1849,9 @@ js--continued-expression-p
              (skip-chars-backward " \t")
              (or (bobp) (backward-char))
              (and (> (point) (point-min))
-                  (save-excursion (backward-char) (not (looking-at "[/*]/")))
+                  ;; Need to exclude => here since
js--looking-at-operator-p thinks
+                  ;; it's looking at an assignment operator
+                  (save-excursion (backward-char) (not (looking-at
"[/*]/\\|=>")))
                   (js--looking-at-operator-p)
                   (and (progn (backward-char)
                               (not (looking-at "+\\+\\|--\\|/[/*]"))))))))))
@@ -2078,6 +2080,23 @@ js--maybe-goto-declaration-keyword-end
         (when comma-p
           (goto-char (1+ declaration-keyword-end))))))))

+(defconst js--line-terminating-arrow "\\s-*=>\\s-*\\(/[/*]\\|$\\)"
+  "Regexp to match a \"=>\" token if it's the last non-whitespace,
non-comment token in a line.")
+
+(defun js--looking-at-broken-arrow-function-p ()
+  "Helper function for `js--proper-indentation'.
+Return t if point is at the start of a (possibly async) arrow
+function and the last non-comment, non-whitespace token of the
+current like is the \"=>\" token."
+  (when (looking-at "\\s-*async\\s-*")
+    (goto-char (match-end 0)))
+  (cond
+   ((eq (char-after) ?\()
+    (forward-list)
+    (looking-at-p js--line-terminating-arrow))
+   (t (looking-at-p
+       (concat js--name-re js--line-terminating-arrow)))))
+
 (defun js--proper-indentation (parse-status)
   "Return the proper indentation for the current line."
   (save-excursion
@@ -2108,7 +2127,8 @@ js--proper-indentation
                  (continued-expr-p (js--continued-expression-p)))
              (goto-char (nth 1 parse-status)) ; go to the opening char
              (if (or (not js-indent-align-list-continuation)
-                     (looking-at "[({[]\\s-*\\(/[/*]\\|$\\)"))
+                     (looking-at "[({[]\\s-*\\(/[/*]\\|$\\)")
+                     (progn (forward-char)
(js--looking-at-broken-arrow-function-p)))
                  (progn ; nothing following the opening paren/bracket
                    (skip-syntax-backward " ")
                    (when (eq (char-before) ?\)) (backward-list))
diff --git a/test/manual/indent/js.js b/test/manual/indent/js.js
index b0d8bca..fc39c12 100644
--- a/test/manual/indent/js.js
+++ b/test/manual/indent/js.js
@@ -144,6 +144,15 @@ bar(
   /abc/
 )

+// bug#25904
+foo.bar.baz(very => // A comment
+  very
+).biz(([baz={a: [123]}, boz]) =>
+  baz
+).snarf((snorf) => /* Another comment */
+  snorf
+);
+
 // Local Variables:
 // indent-tabs-mode: nil
 // js-indent-level: 2
-- 
2.7.4




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#25904; Package emacs. Full text available.

Message received at 25904 <at> debbugs.gnu.org:


Received: (at 25904) by debbugs.gnu.org; 23 Nov 2017 21:41:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 23 16:41:57 2017
Received: from localhost ([127.0.0.1]:54241 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eHzFt-0005St-9C
	for submit <at> debbugs.gnu.org; Thu, 23 Nov 2017 16:41:57 -0500
Received: from mail-wm0-f51.google.com ([74.125.82.51]:35658)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1eHzFq-0005Sf-QU
 for 25904 <at> debbugs.gnu.org; Thu, 23 Nov 2017 16:41:55 -0500
Received: by mail-wm0-f51.google.com with SMTP id y80so19043430wmd.0
 for <25904 <at> debbugs.gnu.org>; Thu, 23 Nov 2017 13:41:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:references:from:cc:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=s64jCXpQZFf1LmPbn/ngUt/Eebm8X/T8F9Rs3VDOF9E=;
 b=M+68pI0hzWMDVCa4p+qDHSkVbIcVuzlBX+5f/ElqPfpVQNNbvL3tFIQnVZcwJXmiDN
 EZuowMiBKuKiPMOXjuZicjQF0G7APoFfr5MmY4usf0dEnDASytAs1ZnOuQEcx7bH7mxd
 rpVIi92NmTxNlQZOnhlIQWx4R/hKaGIYCa6RqByEQT4AFNeFiOfImlkyXx1yn1+C2Wtb
 gEZmxixK5gIrUWciXAFALprCtVW1oPiFjKAyV+AX6m96ZPdmBZp1uTJ8YiKq2X2ZuPiF
 lngM4lj8saE7KcLzbrCTrGtRDvgnDoqzK8W0ATcXnn2ctOzuQuTEo6DT7ZEFKktXFBWq
 dHFw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:references:from:cc:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=s64jCXpQZFf1LmPbn/ngUt/Eebm8X/T8F9Rs3VDOF9E=;
 b=DWmtOc4xnYza3C0xWLonb6CNIjfYorhRqQYjzrAGE04upW3xwAw3Gg+wdCb5OgeJFc
 7EmyVRtBkXHQXyfRW46atTvfr9RDSrdN/iNx6YG4aFgAF8FAstb9Kn1jdC/hQwGsd8t2
 rcy5EGxPq7uxoCcjElldCDemvznMR6c7vj28mZcQBXhFYND32t4Fbn6npQ8kZn+2oe82
 MyOLVTUjU4rA2kn13jdoyOdyUGDywH17xIWwe90h1uq8IDGHkAZxNgYIXTg+7maAWcge
 5PEqNPckJAn9oWAmohPCIby47grLOF0dtthDG7c6pjoCAMNNW140yZlYtcDXQoBJdLr5
 oiKw==
X-Gm-Message-State: AJaThX6I4yIOIEqT4QDifQgCKYu7LinJYOWfvvP0Txw+Ps5kVfjPvwsU
 FB/bAQhmQ8G7BBi3i5/VpQUfprvR
X-Google-Smtp-Source: AGs4zMaSGhh03qGc2ixCPSc0doTfTCIU6IXkc1+qQsFasBR84UwUIdmYYDxigvQkQJrgKFXpApDVqA==
X-Received: by 10.28.175.73 with SMTP id y70mr9028453wme.21.1511473308614;
 Thu, 23 Nov 2017 13:41:48 -0800 (PST)
Received: from [192.168.1.3] ([185.105.174.193])
 by smtp.googlemail.com with ESMTPSA id k30sm34968828wrf.63.2017.11.23.13.41.46
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 23 Nov 2017 13:41:47 -0800 (PST)
Subject: Re: bug#25904: Formatting bug with js-mode
To: Felipe Ochoa <felipeochoa0918@HIDDEN>
References: <CAEtRwfCeH8yeiaCc+wF3mRtvVh3F0PTi7G5HvjSrzBuH_EQrMw@HIDDEN>
 <87shdp63vk.fsf@HIDDEN> <7f9fd974-e768-b532-ad86-33adb531d189@HIDDEN>
 <87y3n0mvzd.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <ffa9276c-f384-45d4-f806-6d4b53093a15@HIDDEN>
Date: Thu, 23 Nov 2017 23:41:45 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101
 Thunderbird/57.0
MIME-Version: 1.0
In-Reply-To: <87y3n0mvzd.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.1 (/)
X-Debbugs-Envelope-To: 25904
Cc: 25904 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.1 (/)

On 11/21/17 12:22 AM, Felipe Ochoa wrote:

> I've added a test to js.js in the latest patch below.

Thanks.

>> To allow comments between the opening paren and the arglist? Does 
>> anybody write them there?
> 
> Oops -- this comment was supposed to be after the arrow. I was thinking 
> of return type annotation comments, but I just checked flow and I don't 
> think they support this. We can just remove the comment

Sure.

> Is there an arglist regexp already in use somewhere? I'd rather not roll 
> my own since dealing with default argument values and spreads and such 
> seems quite challenging.

No, sorry, I forgot about destructuring and etc. forward-list is fine here.

>> If it's not one regexp, moving some of the new code into a helper 
>> function (with a sensible name) seems prudent.
> 
> I've done this in the latest patch.

Thanks.

> +(defun js--looking-at-broken-arrow-function-p ()
> +  "Helper function for `js--proper-indentation'.
> +Return t if point is at the start of a (possibly async) arrow
> +function and the last non-comment, non-whitespace token of the
> +current like is the \"=>\" token."
> +  (and (looking-at "\\s-*\\(async\\s-*\\)?")

This looks weird: the regexp will always match. Better to write it as

(if (looking-at NON-OPT-REGEXP) (goto-char ...)), where NON-OPT-REGEXP 
does not include the optional qualifier (?).

And the (save-excursion...) form seems unnecessary, since the caller 
already uses it.

> +       (save-excursion
> +         (goto-char (match-end 0))
> +         (cond
> +          ((eq (char-after) ?\()
> +           (forward-list) ; Is this better than forward-sexp?

I think so: it should be a bit faster, and it doesn't require you to 
bind forward-sexp-function to nil (for e.g. js2-mode).

> +           (looking-at-p "\\s-*=>\\s-*\\(/[/*]\\|$\\)"))
> +          (t (looking-at-p
> +              (concat js--name-re "\\s-*=>\\s-*\\(/[/*]\\|$\\)")))))))

Should we extract "\\s-*=>\\s-*\\(/[/*]\\|$\\)" to a local variable, or 
a constant?

> (defun js--proper-indentation (parse-status)
>    "Return the proper indentation for the current line."
>    (save-excursion
> @@ -2107,7 +2124,12 @@ indentation is aligned to that column."
>                   (continued-expr-p (js--continued-expression-p)))
>               (goto-char (nth 1 parse-status)) ; go to the opening char
>               (if (or (not js-indent-align-list-continuation)
> -                     (looking-at "[({[]\\s-*\\(/[/*]\\|$\\)"))
> +                     (looking-at "[({[]\\s-*\\(/[/*]\\|$\\)")
> +                     (when (eq (char-after) ?\()
> +                       (save-excursion
> +                         (forward-char)
> +                         (skip-syntax-forward " ")

This seems a bit extraneous: the regexps in the called function all 
start with "\\s-*", right? Let's maybe have the one or the other.

> +                         (js--looking-at-broken-arrow-function-p))))
>                   (progn ; nothing following the opening paren/bracket
>                     (skip-syntax-backward " ")
>                     (when (eq (char-before) ?\)) (backward-list))
> diff --git a/test/manual/indent/js.js b/test/manual/indent/js.js
> index b0d8bca..2286cc1 100644
> --- a/test/manual/indent/js.js
> +++ b/test/manual/indent/js.js
> @@ -144,6 +144,15 @@ bar(
>    /abc/
> )
> 
> +// #25904

We write references to debbugs as bug#25904. bug-reference-mode can 
linkify the result.

> +foo.bar.baz(very =>
> +  very
> +).biz(([baz={a: [123]}, boz]) =>
> +  baz
> +).snarf((snorf) =>
> +  snorf
> +);
> +

Thank you.

Please attach the resulting patch as a file produced by 'git 
format-patch', with a ChangeLog style message entry, as described in 
CONTRIBUTE.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#25904; Package emacs. Full text available.

Message received at 25904 <at> debbugs.gnu.org:


Received: (at 25904) by debbugs.gnu.org; 20 Nov 2017 22:22:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 20 17:22:25 2017
Received: from localhost ([127.0.0.1]:49602 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eGuSP-0002OG-7w
	for submit <at> debbugs.gnu.org; Mon, 20 Nov 2017 17:22:25 -0500
Received: from mail-ua0-f169.google.com ([209.85.217.169]:40671)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <felipeochoa0918@HIDDEN>) id 1eGuSN-0002O2-I3
 for 25904 <at> debbugs.gnu.org; Mon, 20 Nov 2017 17:22:23 -0500
Received: by mail-ua0-f169.google.com with SMTP id z43so6978295uac.7
 for <25904 <at> debbugs.gnu.org>; Mon, 20 Nov 2017 14:22:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=references:from:to:cc:subject:in-reply-to:date:message-id
 :mime-version; bh=zuw+cvCzrWlLyu5Y/6QiJVGpKjUjSxN3Y5Vdj3Ei/Lk=;
 b=fzMgchiUudI3wqbpSP3h5H3BX1Lc6Hoqwxfi7/fUYQj03dcJvJzXQyjbCNP8Scuf9l
 kFD+Ugzcv/id+LfAeWct9ps9CGWwBZZ5iuTdGEeuU4uy72F2jljDQqy0b9c93d0hTuWM
 HoYff9z7PEes6D9d70FHcxpPFC737SyrVZDwj2XE544uYBHL862kJaDEe09TkI6WKfXs
 1Bi9gdgfPA7fdLwWO9pFZkRXt+Jy1CLd5iL297U3a+cT40EYEJjlDEIaMsv0Jj4dG200
 +6d36F927iu/nQzC4uLHH8wk75761TcwgSsMTxiA0Sxvl3IVEMJZ+qwqWGQAj9QIXtVn
 XOsw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:references:from:to:cc:subject:in-reply-to:date
 :message-id:mime-version;
 bh=zuw+cvCzrWlLyu5Y/6QiJVGpKjUjSxN3Y5Vdj3Ei/Lk=;
 b=lEsHbbL0vYnaYbpvBCt6Z1JOZXzNrYCTYa1VlaEH1shGOopXnKhr/HBQC9oWIy6yPp
 2xgTm2i5M/WbHUnAeCNOJBHJCRYLV9KeqtQyejmadu2b4pJUbxmB9Lv3G8tv9nyYm0UK
 NmJeNULnGczlX+AheWQ1rFAgUK2ClP6yB1wvX6koEKiQazPWruzJVlosNrqyruDBIeaF
 /52ciRMZFy6kfmkNQBtC8jj+MLTlrAhrAJBBqrhsTct7pAhZXIqHrk72Zl45oWWLx7jS
 AkT0LeywkLHQf776SB+9dF0seXok+rSA1zA3S4sI2qzVIkuLbSX28L1Ak1jjOktNIaHh
 cuuw==
X-Gm-Message-State: AJaThX42FDGB2h9VbbqYF7NVoEodWlTLaqsGa0pwjfoLV6oj6locJSVG
 nh6BmT6GKWBmOeiiKtBT54Byqhq9
X-Google-Smtp-Source: AGs4zMZEGOjvc/7UFxqpr5ywmIKVAIwiDyK6i8CZEWDVwrY33xPN3x9B1tAobR08dYATPT6EMzlCrA==
X-Received: by 10.176.24.74 with SMTP id j10mr12541274uag.18.1511216537835;
 Mon, 20 Nov 2017 14:22:17 -0800 (PST)
Received: from x1-ubuntu ([181.60.234.59])
 by smtp.gmail.com with ESMTPSA id 193sm1443912vkp.38.2017.11.20.14.22.15
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 20 Nov 2017 14:22:16 -0800 (PST)
References: <CAEtRwfCeH8yeiaCc+wF3mRtvVh3F0PTi7G5HvjSrzBuH_EQrMw@HIDDEN>
 <87shdp63vk.fsf@HIDDEN> <7f9fd974-e768-b532-ad86-33adb531d189@HIDDEN>
From: Felipe Ochoa <felipeochoa0918@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#25904: Formatting bug with js-mode
In-reply-to: <7f9fd974-e768-b532-ad86-33adb531d189@HIDDEN>
Date: Mon, 20 Nov 2017 17:22:14 -0500
Message-ID: <87y3n0mvzd.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 25904
Cc: 25904 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.2 (/)

Hi Dmitry!

> I think the code is reasonable, but the patch needs a few 
> examples for emacs/test/manual/js*.js. Maybe add a new file, or 
> maybe reuse an existing one.

I've added a test to js.js in the latest patch below. 
 
> It also wouldn't hurt that the existing examples are unchanged 
> with the new code.

I checked all the existing examples manually and all were 
unchanged when applying indent-region on the entire buffer.

> To allow comments between the opening paren and the arglist? 
> Does anybody write them there?

Oops -- this comment was supposed to be after the arrow. I was 
thinking of return type annotation comments, but I just checked 
flow and I don't think they support this. We can just remove the 
comment

> I imagine this (*) could be transformed into a single regexp, 
> though it would be pretty complex (rx could help, though!).
>
> (*) Looking at an opening paren followed by ([optional] lambda 
> arglist and an arrow) then [optional] comment and newline.

Is there an arglist regexp already in use somewhere? I'd rather 
not roll my own since dealing with default argument values and 
spreads and such seems quite challenging.

> If it's not one regexp, moving some of the new code into a 
> helper function (with a sensible name) seems prudent.

I've done this in the latest patch.

---
 lisp/progmodes/js.el     | 26 ++++++++++++++++++++++++--
 test/manual/indent/js.js |  9 +++++++++
 2 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 1f86909..6e057b0 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -1848,7 +1848,9 @@ This performs fontification according to `js--class-styles'."
              (skip-chars-backward " \t")
              (or (bobp) (backward-char))
              (and (> (point) (point-min))
-                  (save-excursion (backward-char) (not (looking-at "[/*]/")))
+                  ;; Need to exclude => here since js--looking-at-operator-p thinks
+                  ;; it's looking at an assignment operator
+                  (save-excursion (backward-char) (not (looking-at "[/*]/\\|=>")))
                   (js--looking-at-operator-p)
                   (and (progn (backward-char)
                               (not (looking-at "+\\+\\|--\\|/[/*]"))))))))))
@@ -2077,6 +2079,21 @@ indentation is aligned to that column."
         (when comma-p
           (goto-char (1+ declaration-keyword-end))))))))

+(defun js--looking-at-broken-arrow-function-p ()
+  "Helper function for `js--proper-indentation'.
+Return t if point is at the start of a (possibly async) arrow
+function and the last non-comment, non-whitespace token of the
+current like is the \"=>\" token."
+  (and (looking-at "\\s-*\\(async\\s-*\\)?")
+       (save-excursion
+         (goto-char (match-end 0))
+         (cond
+          ((eq (char-after) ?\()
+           (forward-list) ; Is this better than forward-sexp?
+           (looking-at-p "\\s-*=>\\s-*\\(/[/*]\\|$\\)"))
+          (t (looking-at-p
+              (concat js--name-re "\\s-*=>\\s-*\\(/[/*]\\|$\\)")))))))
+
 (defun js--proper-indentation (parse-status)
   "Return the proper indentation for the current line."
   (save-excursion
@@ -2107,7 +2124,12 @@ indentation is aligned to that column."
                  (continued-expr-p (js--continued-expression-p)))
              (goto-char (nth 1 parse-status)) ; go to the opening char
              (if (or (not js-indent-align-list-continuation)
-                     (looking-at "[({[]\\s-*\\(/[/*]\\|$\\)"))
+                     (looking-at "[({[]\\s-*\\(/[/*]\\|$\\)")
+                     (when (eq (char-after) ?\()
+                       (save-excursion
+                         (forward-char)
+                         (skip-syntax-forward " ")
+                         (js--looking-at-broken-arrow-function-p))))
                  (progn ; nothing following the opening paren/bracket
                    (skip-syntax-backward " ")
                    (when (eq (char-before) ?\)) (backward-list))
diff --git a/test/manual/indent/js.js b/test/manual/indent/js.js
index b0d8bca..2286cc1 100644
--- a/test/manual/indent/js.js
+++ b/test/manual/indent/js.js
@@ -144,6 +144,15 @@ bar(
   /abc/
 )

+// #25904
+foo.bar.baz(very =>
+  very
+).biz(([baz={a: [123]}, boz]) =>
+  baz
+).snarf((snorf) =>
+  snorf
+);
+
 // Local Variables:
 // indent-tabs-mode: nil
 // js-indent-level: 2
--
2.7.4




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#25904; Package emacs. Full text available.

Message received at 25904 <at> debbugs.gnu.org:


Received: (at 25904) by debbugs.gnu.org; 12 Nov 2017 23:02:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 12 18:02:41 2017
Received: from localhost ([127.0.0.1]:37339 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eE1Gx-0002pa-Gz
	for submit <at> debbugs.gnu.org; Sun, 12 Nov 2017 18:02:41 -0500
Received: from mail-wr0-f193.google.com ([209.85.128.193]:54455)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1eE1Gu-0002pJ-Vj
 for 25904 <at> debbugs.gnu.org; Sun, 12 Nov 2017 18:02:37 -0500
Received: by mail-wr0-f193.google.com with SMTP id l22so12874452wrc.11
 for <25904 <at> debbugs.gnu.org>; Sun, 12 Nov 2017 15:02:36 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=9BdIXd2PICnML8XFn2pSQQ9AX9w5xv+hd1o/44NNbik=;
 b=le0qJNJv5aqaphy8rPOEWeFtdIRiN5wBqTRPHU1eKKpg+m80yRfJ53WFXvLAN80d7J
 pWf8Iml3xs7enjB6glYzKIwT0rM/TA9JPQASIYRRcL4jpm+uIESoR1xABSnda19b9LgC
 Uoyyxi1TUsWMqM2WNW79yXXxkd/t/w1SeZl1+ZvPKQVPMqubRWgZ8Y98C8CpGod19cTL
 irhSfbdzoemf4yXh5/5MmEUzfDTzNc8WDQnqe+2eUKc07n4VF5uPAaC+ELuAKNo9KuIE
 XJtC/6OlQS5pehuaL2705+E3xF2Xtkjf2iDwIL1AqkZ38eoBzrmhrvhRw3tpew+52Bmd
 FqtQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=9BdIXd2PICnML8XFn2pSQQ9AX9w5xv+hd1o/44NNbik=;
 b=hwtJvs+zoz3aXb+1c6EX1P9zjt/Ily13YH1SLZYNdaNhJfKRTxMPdch2syyOS4VJLu
 BBJawXieBwvyXGFXBSIcDG1MQlTZmO+paOi0lBnoDeVnjkpp6JBXNnOwoYIoUqeP8m0N
 0ORfHjVmzx3BQfLAeCh+ipToIqKqx//MzUSfclyHvZUJTr4/sp6UNEGGUwcHzrl0jDh3
 O6Yev2ycDOWLF5mVUeMdHaK+UHHbavolnzC9R33oDjoMHRUPgx+so80VRec5TjXOzBo9
 3ZAeo6Ui/HtxkHflv6W9ZHUH3cdTo+wHoizO/H+OYKB7yJR0Z2THZLbw2bzT9lH4j6Bq
 wKpA==
X-Gm-Message-State: AJaThX5Pm2IMRSPsBSXufRQ9sYS/1rB39VmiCKBO+q4wio8yEwS9gD0F
 y80SoyQIQ80WGGg1IRw9/74L7Og0
X-Google-Smtp-Source: AGs4zMaq/djRuxHuSsvqNyJjMNyeZc3FxD+6MDLwlvHSCgx+kmKWfixCm6XQIl0pWdAWLSbNO1C9vQ==
X-Received: by 10.223.157.204 with SMTP id q12mr5835282wre.241.1510527750738; 
 Sun, 12 Nov 2017 15:02:30 -0800 (PST)
Received: from [192.168.1.3] ([185.105.174.193])
 by smtp.googlemail.com with ESMTPSA id l7sm9387309wrg.69.2017.11.12.15.02.28
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 12 Nov 2017 15:02:29 -0800 (PST)
Subject: Re: bug#25904: Formatting bug with js-mode
To: Felipe Ochoa <felipeochoa0918@HIDDEN>, 25904 <at> debbugs.gnu.org
References: <CAEtRwfCeH8yeiaCc+wF3mRtvVh3F0PTi7G5HvjSrzBuH_EQrMw@HIDDEN>
 <87shdp63vk.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <7f9fd974-e768-b532-ad86-33adb531d189@HIDDEN>
Date: Mon, 13 Nov 2017 01:02:28 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101
 Thunderbird/56.0
MIME-Version: 1.0
In-Reply-To: <87shdp63vk.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.6 (--)
X-Debbugs-Envelope-To: 25904
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

Hi Felipe!

On 11/8/17 1:55 AM, Felipe Ochoa wrote:
> Here's an initial implementation of a solution for this issue. (Also 
> filed as js2#314 [1])
> 
> foo.bar.baz(very =>  very  // current code aligns return value to paren 
> above ).biz(baz =>  baz
> );
> 
> I've been using this code successfully for a number of days now, but 
> since it's my first time touching indentation code, it likely needs 
> review for I comments and whitespace handling, etc.

I think the code is reasonable, but the patch needs a few examples for 
emacs/test/manual/js*.js. Maybe add a new file, or maybe reuse an 
existing one.

It also wouldn't hurt that the existing examples are unchanged with the 
new code.

>               (skip-chars-backward " \t")
>               (or (bobp) (backward-char))
>               (and (> (point) (point-min))
> -                  (save-excursion (backward-char) (not (looking-at 
> "[/*]/")))
> +                  ;; Need to exclude => here since 
> js--looking-at-operator-p thinks
> +                  ;; it's looking at an assignment operator
> +                  (save-excursion (backward-char) (not (looking-at 
> "[/*]/\\|=>")))

OK.

> @@ -2107,7 +2109,18 @@ indentation is aligned to that column."
>                   (continued-expr-p (js--continued-expression-p)))
>               (goto-char (nth 1 parse-status)) ; go to the opening char
>               (if (or (not js-indent-align-list-continuation)
> -                     (looking-at "[({[]\\s-*\\(/[/*]\\|$\\)"))
> +                     (looking-at "[({[]\\s-*\\(/[/*]\\|$\\)")
> +                     ;; check for a arrow function without parens
> +                     (and (looking-at "(\\s-*\\(async\\s-*\\)?")
> +                          ;; TODO: should call (forward-comment 
> most-positive-fixnum)?

To allow comments between the opening paren and the arglist? Does 
anybody write them there?

> +                          (save-excursion
> +                            (goto-char (match-end 0))
> +                            (cond
> +                             ((eq (char-after) ?\()
> +                              (forward-sexp)
> +                              (looking-at-p 
> "\\s-*=>\\s-*\\(/[/*]\\|$\\)"))
> +                             (t (looking-at-p
> +                                 (concat js--name-re 
> "\\s-*=>\\s-*\\(/[/*]\\|$\\)")))))))

I imagine this (*) could be transformed into a single regexp, though it 
would be pretty complex (rx could help, though!).

(*) Looking at an opening paren followed by ([optional] lambda arglist 
and an arrow) then [optional] comment and newline.

Arglist matcher might be on the big side, but I'm guessing the 
performance will be better. Not sure how big of an issue this is.

If it's not one regexp, moving some of the new code into a helper 
function (with a sensible name) seems prudent.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#25904; Package emacs. Full text available.

Message received at 25904 <at> debbugs.gnu.org:


Received: (at 25904) by debbugs.gnu.org; 7 Nov 2017 23:55:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 07 18:55:23 2017
Received: from localhost ([127.0.0.1]:57230 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eCDiF-0004FG-Bs
	for submit <at> debbugs.gnu.org; Tue, 07 Nov 2017 18:55:23 -0500
Received: from mail-vk0-f43.google.com ([209.85.213.43]:50019)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <felipeochoa0918@HIDDEN>) id 1eCDiD-0004F3-Rp
 for 25904 <at> debbugs.gnu.org; Tue, 07 Nov 2017 18:55:22 -0500
Received: by mail-vk0-f43.google.com with SMTP id t184so636600vka.6
 for <25904 <at> debbugs.gnu.org>; Tue, 07 Nov 2017 15:55:21 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:subject:date:message-id:mime-version;
 bh=rQwF4W1NYwSOOI7yg7VJ1wMk38m9EeoktDnVtS7btQ8=;
 b=V2kIJHEPGC+5Z4/0vNG75g/EmUFR09cUOTKWgRwnf+6HTwVX4SyS04t04z1R4DkTcW
 sf39w79TerUbn5sfkf0Wi4KGA3snnsGbqdr5AuCkWuwThcA5C0jVPWsLVN8HGMUAoASC
 IEqjpJ+1omfW/BiXFdg7lp2ga9+dQd7MFrGtunMjxnvomKWjxKlUEZg6AtjTPeHRF+Zs
 dw4/O7gWqyjxfRvvzDSU93gbIBDMdZ4TMyFA6S9yrVRKv3zhLfkxOXBpL4KFHkS2rkOi
 2YWqC4wy4Z72GY0Hu/HfSiGKa214emjWu82z62EOIpKEYOqRCyVQ3pqnuWWNYapBpCBG
 Zexg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:date:message-id:mime-version;
 bh=rQwF4W1NYwSOOI7yg7VJ1wMk38m9EeoktDnVtS7btQ8=;
 b=SmGCECpSPi0P4wph1PtiUBb73qufnU2m6fiBHRShTVZglPyY4Lt9hqqdrt2FnV+KI3
 oe2/qsJRwo/zcVc6Zr6C2iYVOQfKpXYDlKm/Y16T+qVgLPTK2T2ebnyGopm93ngFB0pS
 n2B2bj95l4k3F3VhWWuV/e3uauhIh8HlVj4JmQ//v7QC5b6hVQp+BQIm5scYr8gnf//e
 TWGZ35xaCXhMhTRCKkcg6pcUCJc3ivNV6/c/1mzGlr1OThb3Z7cBsDsxmRRFfSmbNSn/
 FXrGrZJPY/X9qIyXeDrT3jWIt3y+D38NwzSpqMcRODgnY8JFwUSY3atnGL0ELWZJVZLG
 detA==
X-Gm-Message-State: AJaThX6cFv8E1P/YNouLJ29W8pLXgKFH97eMkzHizWt91RPYxVCMxGDj
 KEh4V2wMfgKZkSH4usZU6JPOlP5/
X-Google-Smtp-Source: ABhQp+RpX3b8UQ3ANVEP6oUYIdWvSHILeAIRoa8OzTWFeSTmVxlxuSv0TYLKmBmK0PXRv0ryjrBKPg==
X-Received: by 10.31.89.7 with SMTP id n7mr372085vkb.77.1510098916000;
 Tue, 07 Nov 2017 15:55:16 -0800 (PST)
Received: from x1-ubuntu ([181.60.234.59])
 by smtp.gmail.com with ESMTPSA id s16sm487533vka.53.2017.11.07.15.55.14
 for <25904 <at> debbugs.gnu.org>
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 07 Nov 2017 15:55:15 -0800 (PST)
From: Felipe Ochoa <felipeochoa0918@HIDDEN>
To: 25904 <at> debbugs.gnu.org
Subject: Re: Formatting bug with js-mode
Date: Tue, 07 Nov 2017 18:55:11 -0500
Message-ID: <87shdp63vk.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
X-Spam-Score: -2.0 (--)
X-Debbugs-Envelope-To: 25904
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.0 (--)

Here's an initial implementation of a solution for this 
issue. (Also filed as js2#314 [1])

foo.bar.baz(very => 
  very  // current code aligns return value to paren above 
).biz(baz => 
  baz
);

I've been using this code successfully for a number of days now, 
but since it's my first time touching indentation code, it likely 
needs review for I comments and whitespace handling, etc.

(Note: disabling `js-indent-align-list-continuation' also 
addresses this issue, but disabling it changes indentation in 
other parts.)

[1]: https://github.com/mooz/js2-mode/issues/314

---
 lisp/progmodes/js.el | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 1f86909..18f888d 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -1848,7 +1848,9 @@ This performs fontification according to `js--class-styles'."
              (skip-chars-backward " \t")
              (or (bobp) (backward-char))
              (and (> (point) (point-min))
-                  (save-excursion (backward-char) (not (looking-at "[/*]/")))
+                  ;; Need to exclude => here since js--looking-at-operator-p thinks
+                  ;; it's looking at an assignment operator
+                  (save-excursion (backward-char) (not (looking-at "[/*]/\\|=>")))
                   (js--looking-at-operator-p)
                   (and (progn (backward-char)
                               (not (looking-at "+\\+\\|--\\|/[/*]"))))))))))
@@ -2107,7 +2109,18 @@ indentation is aligned to that column."
                  (continued-expr-p (js--continued-expression-p)))
              (goto-char (nth 1 parse-status)) ; go to the opening char
              (if (or (not js-indent-align-list-continuation)
-                     (looking-at "[({[]\\s-*\\(/[/*]\\|$\\)"))
+                     (looking-at "[({[]\\s-*\\(/[/*]\\|$\\)")
+                     ;; check for a arrow function without parens
+                     (and (looking-at "(\\s-*\\(async\\s-*\\)?")
+                          ;; TODO: should call (forward-comment most-positive-fixnum)?
+                          (save-excursion
+                            (goto-char (match-end 0))
+                            (cond
+                             ((eq (char-after) ?\()
+                              (forward-sexp)
+                              (looking-at-p "\\s-*=>\\s-*\\(/[/*]\\|$\\)"))
+                             (t (looking-at-p
+                                 (concat js--name-re "\\s-*=>\\s-*\\(/[/*]\\|$\\)")))))))
                  (progn ; nothing following the opening paren/bracket
                    (skip-syntax-backward " ")
                    (when (eq (char-before) ?\)) (backward-list))
--
2.7.4




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#25904; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 28 Feb 2017 23:07:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 28 18:07:00 2017
Received: from localhost ([127.0.0.1]:60673 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ciqrD-0002wp-Tv
	for submit <at> debbugs.gnu.org; Tue, 28 Feb 2017 18:07:00 -0500
Received: from eggs.gnu.org ([208.118.235.92]:49447)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <aikeru@HIDDEN>) id 1ciqbH-0002YS-O4
 for submit <at> debbugs.gnu.org; Tue, 28 Feb 2017 17:50:32 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <aikeru@HIDDEN>) id 1ciqbB-0001QX-Ce
 for submit <at> debbugs.gnu.org; Tue, 28 Feb 2017 17:50:26 -0500
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,
 HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:42366)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <aikeru@HIDDEN>) id 1ciqbB-0001QT-9D
 for submit <at> debbugs.gnu.org; Tue, 28 Feb 2017 17:50:25 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:40417)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <aikeru@HIDDEN>) id 1ciqbA-0006OB-01
 for bug-gnu-emacs@HIDDEN; Tue, 28 Feb 2017 17:50:25 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <aikeru@HIDDEN>) id 1ciqb8-0001PR-Rn
 for bug-gnu-emacs@HIDDEN; Tue, 28 Feb 2017 17:50:24 -0500
Received: from mail-qk0-x234.google.com ([2607:f8b0:400d:c09::234]:35899)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <aikeru@HIDDEN>) id 1ciqb8-0001OO-Ms
 for bug-gnu-emacs@HIDDEN; Tue, 28 Feb 2017 17:50:22 -0500
Received: by mail-qk0-x234.google.com with SMTP id n186so41732919qkb.3
 for <bug-gnu-emacs@HIDDEN>; Tue, 28 Feb 2017 14:50:21 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:in-reply-to:references:from:date:message-id:subject:to;
 bh=4vPvFrmVJwanbg3YQpRViGLIeYnbcNiQQdVF15KRBJM=;
 b=fa6ZG5dNdS09t/5F6vz3XT5HNlWDGDUAbHkpwIG3iFeKHktbB4xQvb8S9p4ZP7Pf4c
 cgGFDmnbxbCLS7xyp3+iVGEmEBOIqufcOFvhg53q4D85MfNRme9u0M7jXLoKIX2D29bn
 k1XDX2zA6uc2hjDij5pEmgIhTcFDdG9xqbU+CMQqx7EaM77/0RuTkeXCgthGNjG/oEGz
 9uL2xyJlO2afZ8nPMyVVyc9TEcg2IBSvP8P4P1ekESBAWyp1Sv8FIFxwBNh+AWxh2kS7
 Tzen0NrcAKXdqfAXGlGhUXYaV1kFV9CcqncAvr1NMqcstD6KuEYJdX2su/MuKnb/rJZZ
 59FA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:in-reply-to:references:from:date
 :message-id:subject:to;
 bh=4vPvFrmVJwanbg3YQpRViGLIeYnbcNiQQdVF15KRBJM=;
 b=hodZ0/93UvvzkC3orcgNJfXVPP5MZOySYKZ3d1qr1WBDgRBeydGhvPnhEDqfQeKprk
 kUzeRFgdhxjydqcapP+t2sw/Er8oNALAAUqxW5dnjNiuEl6mSs3V7tpVc6WdOajeO7kQ
 VcX8etV0tGpFXfQ2p+ALGr8L5/NnH8xtBy8lVdbyRoYoDHty3INYWs2FG+Vy9jXrOG3o
 L+w9v76m1t4TU3q7/EncU70qMEhjqp79UO2LQsIle1zfl/Y1KfM6IFFgSWcUKAFNirU6
 UwqcUOjhmUJQj5woumoBMX7HpmBCMyrwGJmCfxaaxFx0DwVdtgK57phQqE330v6A7+GC
 jc8w==
X-Gm-Message-State: AMke39m1QB1aSITeRHbFUg+Y2I6baDUFaumcyXCD5CEuz+NTHOYq7Jy3uwmOxllm76Os94+72WmCgra2v09U6g==
X-Received: by 10.237.33.143 with SMTP id l15mr5939227qtc.222.1488322220384;
 Tue, 28 Feb 2017 14:50:20 -0800 (PST)
MIME-Version: 1.0
Received: by 10.12.137.135 with HTTP; Tue, 28 Feb 2017 14:50:19 -0800 (PST)
Received: by 10.12.137.135 with HTTP; Tue, 28 Feb 2017 14:50:19 -0800 (PST)
In-Reply-To: <CAEtRwfA5_ibO2tmKCDtOHOs9ZCYosn21sKe5gC9LhE3y54GDyQ@HIDDEN>
References: <CAEtRwfDCdNSBPH=1Ohe3sBZJ70QBzJY3nd+Xs0uk85EuA3GRtw@HIDDEN>
 <CAEtRwfA5_ibO2tmKCDtOHOs9ZCYosn21sKe5gC9LhE3y54GDyQ@HIDDEN>
From: Michael Snead <aikeru@HIDDEN>
Date: Tue, 28 Feb 2017 17:50:19 -0500
Message-ID: <CAEtRwfCeH8yeiaCc+wF3mRtvVh3F0PTi7G5HvjSrzBuH_EQrMw@HIDDEN>
Subject: Formatting bug with js-mode
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/alternative; boundary=001a113d0ce6420b1705499f05be
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: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Tue, 28 Feb 2017 18:06:59 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

--001a113d0ce6420b1705499f05be
Content-Type: text/plain; charset=UTF-8

Hi there. Apologies if this is the wrong place to submit a bug on js-mode
for emacs. I am an emacs newbie (in fact, I've only used spacemacs and
still relatively new there too) and not sure where to post about this.

Basically I am trying to find the right place to report this issue, which
was determined to be an upstream issue with js-mode:

https://github.com/felipeochoa/rjsx-mode/issues/34

In essence, a fat arrow expression followed by a linefeed, followed by an
expression (such as a JSX tag with children) that is not wrapped in
parenthesis is valid syntax and recognized by editors like WebStorm and
VSCode but doesn't work correctly in this editor.

If this is not the right place I would be grateful for directions on where
this bug belongs.

Thanks!

--001a113d0ce6420b1705499f05be
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto">Hi there. Apologies if this is the wrong place to submit =
a bug on js-mode for emacs. I am an emacs newbie (in fact, I&#39;ve only us=
ed spacemacs and still relatively new there too) and not sure where to post=
 about this.<div dir=3D"auto"><br></div><div dir=3D"auto">Basically I am tr=
ying to find the right place to report this issue, which was determined to =
be an upstream issue with js-mode:</div><div dir=3D"auto"><br></div><div di=
r=3D"auto"><a href=3D"https://github.com/felipeochoa/rjsx-mode/issues/34">h=
ttps://github.com/felipeochoa/rjsx-mode/issues/34</a><br></div><div dir=3D"=
auto"><br></div><div dir=3D"auto">In essence, a fat arrow expression follow=
ed by a linefeed, followed by an expression (such as a JSX tag with childre=
n) that is not wrapped in parenthesis is valid syntax and recognized by edi=
tors like WebStorm and VSCode but doesn&#39;t work correctly in this editor=
.</div><div dir=3D"auto"><br></div><div dir=3D"auto">If this is not the rig=
ht place I would be grateful for directions on where this bug belongs.</div=
><div dir=3D"auto"><br></div><div dir=3D"auto">Thanks!</div></div>

--001a113d0ce6420b1705499f05be--




Acknowledgement sent to Michael Snead <aikeru@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#25904; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 13 Feb 2019 00:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.