From unknown Fri Jun 20 07:09:17 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#24896 <24896@debbugs.gnu.org> To: bug#24896 <24896@debbugs.gnu.org> Subject: Status: JSX prop indentation after fat arrow Reply-To: bug#24896 <24896@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:09:17 +0000 retitle 24896 JSX prop indentation after fat arrow reassign 24896 emacs submitter 24896 Felipe Ochoa severity 24896 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 07 11:34:30 2016 Received: (at submit) by debbugs.gnu.org; 7 Nov 2016 16:34:31 +0000 Received: from localhost ([127.0.0.1]:48582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3msQ-0007Lb-ME for submit@debbugs.gnu.org; Mon, 07 Nov 2016 11:34:30 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3gfJ-0002Ve-3q for submit@debbugs.gnu.org; Mon, 07 Nov 2016 04:56:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c3gfC-0000NL-KQ for submit@debbugs.gnu.org; Mon, 07 Nov 2016 04:56:27 -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]:33381) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c3gfC-0000NH-HZ for submit@debbugs.gnu.org; Mon, 07 Nov 2016 04:56:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c3gfB-0001II-4x for bug-gnu-emacs@gnu.org; Mon, 07 Nov 2016 04:56:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c3gfA-0000Me-2B for bug-gnu-emacs@gnu.org; Mon, 07 Nov 2016 04:56:25 -0500 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:38616) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c3gf9-0000MO-Pz for bug-gnu-emacs@gnu.org; Mon, 07 Nov 2016 04:56:23 -0500 Received: by mail-wm0-x235.google.com with SMTP id f82so107191650wmf.1 for ; Mon, 07 Nov 2016 01:56:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=VJmS/V1XIZDsh/rB37q8xNSwF79geYioHeOeS7gi8e4=; b=Fh8AG5UvMBGDId7JkcXw8EOs5xNgT9jcwXIWGoSxFP29rCv0q4+YniwjzRxohEw5YZ J0Khc0TVSwBAALIyjUG2xjzqwDoefzKREauQp9RyNQjwTyIxsbAr0uNBwTxwMcOPVJ1H Fn9WJN9UiEwY+LynH/kfZ3zC7qq/uYVMT8pq8zYHI1OI8xeG8sNRrGRPwvmk7UaFd2I+ ia+iY4wswIoDGh3PBV+wgW9G6T5E4tHrUR6PdnORfbS1wCjy4fWjIsN7NEy8XTVSrfCS Ab6dUc+iM28zL03pcFEqCUnS1KQK+n9awJ3KG4AtJGxhUkRc/NG4ee1AHQmvxE6hgcmo Oc7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=VJmS/V1XIZDsh/rB37q8xNSwF79geYioHeOeS7gi8e4=; b=exA1epqMbnHWlblebABBm79a9/qNRbYLX0MtxY8/FhPcIjg/CbD0gX01D4iqilu1p0 Q/XizWDS2zsIXfmc58OfbsQKOV32X/yE/TSFagVRI5oXsmInXBA55m1T2O+x8HY69N+9 F1SFvTuf5HOX8cIyQS5d5fEHb9uTtuh7cldekZsR0/2rAQ/aSh03m9yUQlob8jCwKzsl 3noE3O4x8U43qOTzScPD8nIpx90xlNKjGTmnmrKZEPvefAGLkA7i/Cg8HafNj9zimlFh esx7a84iazft0mUNmIRrUTLc2T1rkWeSGbxjxJC3f5BpWqoD/AArJxrDUjhN/fbxWftk Dfdw== X-Gm-Message-State: ABUngvfoL2K2ujyzEtLz6XDK2S93/xlpwIt+Dqo0epW7AnMIS91nP7T0TMvpqSgHxgUHhPXFjCZny4mQ6tERDA== X-Received: by 10.194.203.5 with SMTP id km5mr5638517wjc.230.1478512581816; Mon, 07 Nov 2016 01:56:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.185.5 with HTTP; Mon, 7 Nov 2016 01:56:21 -0800 (PST) From: Felipe Ochoa Date: Mon, 7 Nov 2016 10:56:21 +0100 Message-ID: Subject: JSX prop indentation after fat arrow To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=047d7bae45323c37730540b30929 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: Mon, 07 Nov 2016 11:34:29 -0500 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: -4.0 (----) --047d7bae45323c37730540b30929 Content-Type: text/plain; charset=UTF-8 (Preemptive apologies if this is the wrong list/format for this comment -- first time filer here!) When indenting JSX code using js2- or js-mode, the indentation function gets confused when there's a fat arrow function in a JSX prop. Compare the way the following two code blocks are auto-indented: const Component = props => ( // Incorrect indentation c} b={123}> ); const Component = props => ( // Correct indentation ); I've tracked the problem down to `sgml-calculate-indent' using `parse-partial-sexp' with `sgml-tag-syntax-table', where `>' is treated as a close-parenthesis character (and thus the end-of-tag marker). I don't think there's a way to patch the syntax table that would let `>' flip between punctuation and close-parens based on context, but one possible fix when using js2-mode (not sure about js-mode) is to apply a "." 'syntax-table text property to the `>' when parsing a fat arrow. Unfortunately, `js-jsx-indent-line' calls `sgml-indent-line' using `js--as-sgml', which sets `parse-sexp-lookup-properties' to nil. Would there be any harm in setting `parse-sexp-lookup-properties' to t instead? As far as I can tell, js-mode and js2-mode only use 'syntax-table propeties for regex literals. As a side-note, there may well be a different solution to this problem; I still don't understand why the following block is indented correctly: const Component = props => ( /} b={123}> ); --047d7bae45323c37730540b30929 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
(Pree= mptive apologies if this is the wrong list/format for this comment -- first= time filer here!)

When indenting JSX code using js2- or js-mode, the indentation function gets confus= ed when there's a fat arrow function in a JSX prop. Compare the way the following two code blocks are=20 auto-indented:

const Co= mponent =3D props =3D> ( // Incorrect indentation
=C2=A0=C2=A0=C2=A0 = <FatArrow a=3D{e =3D> c}
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 b=3D{123}&= gt;
=C2=A0=C2=A0=C2=A0 </FatArrow>
);

const Component =3D props =3D> ( // Correct indentation
=C2= =A0=C2=A0=C2=A0 <NoFatArrow a=3D{123}
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 b=3D{123}>
=C2=A0=C2=A0=C2= =A0 </NoFatArrow>
);

I've tracked the problem down to `= sgml-calculate-indent' using `parse-partial-sexp' with=20 `sgml-tag-syntax-table', where `>' is treated as a close-parenth= esis=20 character (and thus the end-of-tag marker). I don't think there's a= way to patch the syntax table that=20 would let `>' flip between punctuation and close-parens based on=20 context, but one possible fix when using js2-mode (not sure about js-mode) = is to apply a "." 'syntax-table text property to the `>= 9; when parsing a fat arrow.

Unfortunately, `js-jsx-indent-line'= calls `sgml-indent-line' using `js--as-sgml', which sets `parse-se= xp-lookup-properties' to nil.

Would there be any harm in
= setting `parse-sexp-lookup-= properties' to t instead? As far as I can tell, js-mode and js2-mode on= ly use 'syntax-table propeties for regex literals.


As a side-note, th= ere may well be a different solution to this problem; I still don't und= erstand why the following block is indented correctly:

const Compone= nt =3D props =3D> (
=C2=A0=C2=A0=C2=A0 <WithRegex a=3D{/>/}
= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 b=3D{123}>
=C2=A0=C2=A0=C2=A0 </WithRegex>
);
<= /span>
--047d7bae45323c37730540b30929-- From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 19 17:47:30 2016 Received: (at 24896) by debbugs.gnu.org; 19 Nov 2016 22:47:30 +0000 Received: from localhost ([127.0.0.1]:35378 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c8EPy-0000B3-JT for submit@debbugs.gnu.org; Sat, 19 Nov 2016 17:47:30 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:37263) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c8EPx-0000Ap-4k for 24896@debbugs.gnu.org; Sat, 19 Nov 2016 17:47:29 -0500 Received: by mail-wm0-f49.google.com with SMTP id t79so88734013wmt.0 for <24896@debbugs.gnu.org>; Sat, 19 Nov 2016 14:47:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=DJktXCQYAOqM1JTawrgH6husq8+4uzMMS0Q87VluIpY=; b=ZHbVX8TDv+EUay5ed8nRZ8C2niFKAZuOWXz75knqoslmGRxs3UY37zKfrQLYBnr4kG TpsqMQZNXn8j+bFx0GBjnxEDY0KcJZLCllnDFIT8MTzS88n/34wxyX3JNJlVGAAQvfBV wu78sgxw4Tn8ueDmZLgjSzK1m1stE0UccQn7uwhauu8BcL2zqMpGMrYsaVhIr5XrQRq7 iA5KYkJH3oRlQMnGH0pUDNaV0KbOiJFABYrzoyUxnfPyYe2S5qJJHF4Fc9Bce2gCkmXa 1uLJlTyuaGt6EKiSRUvUNwP4qWg0mlnlYIKDQi9lXaEdVIYg6Kai5QyHB9Y8hcvBvn/7 qzsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=DJktXCQYAOqM1JTawrgH6husq8+4uzMMS0Q87VluIpY=; b=fRgz9GMDAWoQW+teRBzcVFEPj3wX5TnwAGyPzKDGmHbjI5q19kezysglhfvL8UsKx4 /ZmDKlmY9nOGnglq0pG5hl6HElWHTO2N2HBlsiQoKTULkdFa8Dm9RJD1xyNR4cWvUw0a 318jGIVQ9Tb9S2BkxJ2Yfbz8C7hlo94xPxeWJAXIwGLgSKUnsRSzH9IJgxjhAt8+ozaZ ZZtnsH7EoArnoOzAAkFnlCPRbvd3HoNcJtfWxLEZmeH7NoCBMZqEeKv0yZ9YZmTFbXoi oYutPa3A24CHWU789Lx+DyaIps57wnsX2jyz9v7lz4E/vnFx9/lifPTkiYZYNf6B6c4l I/Vw== X-Gm-Message-State: AKaTC03/O6+Dtp3gj1gQryr1WXkWYJN2HbOcvAtGwGGvRV2RmimOVb1JsJQGykhkkFfhcQ== X-Received: by 10.28.199.71 with SMTP id x68mr5490287wmf.34.1479595643130; Sat, 19 Nov 2016 14:47:23 -0800 (PST) Received: from [192.168.1.3] ([185.105.173.41]) by smtp.googlemail.com with ESMTPSA id f3sm10935691wmf.10.2016.11.19.14.47.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 19 Nov 2016 14:47:22 -0800 (PST) Subject: Re: bug#24896: JSX prop indentation after fat arrow To: Felipe Ochoa , 24896@debbugs.gnu.org, Jackson Hamilton References: From: Dmitry Gutov Message-ID: <6d48deda-1d14-2d50-ca86-c89f35bf37db@yandex.ru> Date: Sun, 20 Nov 2016 00:47:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0 MIME-Version: 1.0 In-Reply-To: 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: 24896 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) Hi! On 07.11.2016 11:56, Felipe Ochoa wrote: > (Preemptive apologies if this is the wrong list/format for this comment > -- first time filer here!) Not at all, thanks for the report. > I > don't think there's a way to patch the syntax table that would let `>' > flip between punctuation and close-parens based on context, but one > possible fix when using js2-mode (not sure about js-mode) I wonder what could be done in js-mode, too. A syntax-propertize-function rule, maybe. > is to apply a > "." 'syntax-table text property to the `>' when parsing a fat arrow. > > Unfortunately, `js-jsx-indent-line' calls `sgml-indent-line' using > `js--as-sgml', which sets `parse-sexp-lookup-properties' to nil. > > Would there be any harm in setting `parse-sexp-lookup-properties' to t > instead? As far as I can tell, js-mode and js2-mode only use > 'syntax-table propeties for regex literals. They also set that variable to t anyway. The only possible danger might come from sgml-mode, which does not do that. I'm not sure which danger exactly, because all examples in test/indent/js-jsx.js seem to behave identically whether js--as-sgml includes the parse-sexp-lookup-properties binding or not. Jackson, could you maybe shed some light on this? From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 22 00:50:05 2016 Received: (at 24896) by debbugs.gnu.org; 22 Nov 2016 05:50:06 +0000 Received: from localhost ([127.0.0.1]:37701 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c93y1-0002K5-MZ for submit@debbugs.gnu.org; Tue, 22 Nov 2016 00:50:05 -0500 Received: from erelay3.ox.registrar-servers.com ([192.64.117.2]:55939) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c93xz-0002Ju-Jq for 24896@debbugs.gnu.org; Tue, 22 Nov 2016 00:50:04 -0500 Received: from localhost (unknown [127.0.0.1]) by erelay1.ox.registrar-servers.com (Postfix) with ESMTP id A35972206FB9; Tue, 22 Nov 2016 05:50:02 +0000 (UTC) Received: from erelay1.ox.registrar-servers.com ([127.0.0.1]) by localhost (erelay.ox.registrar-servers.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ecd_GuCRJa7j; Tue, 22 Nov 2016 00:50:01 -0500 (EST) Received: from MTA-05.privateemail.com (unknown [10.20.150.150]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by erelay1.ox.registrar-servers.com (Postfix) with ESMTPS id AA8AC2206FAE; Tue, 22 Nov 2016 00:50:01 -0500 (EST) Received: from [192.168.1.123] (unknown [10.20.151.208]) by MTA-05.privateemail.com (Postfix) with ESMTPA id BAAE16003C; Tue, 22 Nov 2016 05:50:00 +0000 (UTC) Subject: Re: bug#24896: JSX prop indentation after fat arrow To: Dmitry Gutov , Felipe Ochoa , 24896@debbugs.gnu.org References: <6d48deda-1d14-2d50-ca86-c89f35bf37db@yandex.ru> From: Jackson Ray Hamilton X-Enigmail-Draft-Status: N1110 Message-ID: <77f1f91d-2f8c-0509-7a16-50bae68f3883@jacksonrayhamilton.com> Date: Mon, 21 Nov 2016 21:48:45 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <6d48deda-1d14-2d50-ca86-c89f35bf37db@yandex.ru> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 24896 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.7 (/) Hi guys, Sorry that I cannot provide a definitive answer for the purpose of that line of code - I probably should have provided a more detailed comment or committed in smaller hunks - but I'll make a guess informed by the way I usually think, and thus probably thought, when I wrote that. When figuring out how to get `sgml-indent-line' to behave correctly, and upon discovering that I needed to use `with-syntax-table', I probably read the manual entry on syntax tables and discovered the existence of `parse-sexp-lookup-properties', and as a (redundant) safety measure tried to emulate the sgml-mode environment as closely as possible. If the tests still pass then let's try enabling it. Jackson On 11/19/2016 02:47 PM, Dmitry Gutov wrote: > Hi! > > On 07.11.2016 11:56, Felipe Ochoa wrote: >> (Preemptive apologies if this is the wrong list/format for this comment >> -- first time filer here!) > > Not at all, thanks for the report. > >> I >> don't think there's a way to patch the syntax table that would let `>' >> flip between punctuation and close-parens based on context, but one >> possible fix when using js2-mode (not sure about js-mode) > > I wonder what could be done in js-mode, too. A > syntax-propertize-function rule, maybe. > >> is to apply a >> "." 'syntax-table text property to the `>' when parsing a fat arrow. >> >> Unfortunately, `js-jsx-indent-line' calls `sgml-indent-line' using >> `js--as-sgml', which sets `parse-sexp-lookup-properties' to nil. >> >> Would there be any harm in setting `parse-sexp-lookup-properties' to t >> instead? As far as I can tell, js-mode and js2-mode only use >> 'syntax-table propeties for regex literals. > > They also set that variable to t anyway. The only possible danger might > come from sgml-mode, which does not do that. > > I'm not sure which danger exactly, because all examples in > test/indent/js-jsx.js seem to behave identically whether js--as-sgml > includes the parse-sexp-lookup-properties binding or not. > > Jackson, could you maybe shed some light on this? From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 08 06:12:49 2016 Received: (at 24896) by debbugs.gnu.org; 8 Dec 2016 11:12:49 +0000 Received: from localhost ([127.0.0.1]:60779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cEwd7-0001K4-7b for submit@debbugs.gnu.org; Thu, 08 Dec 2016 06:12:49 -0500 Received: from mail-ua0-f171.google.com ([209.85.217.171]:35050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cEwd6-0001Jq-Bk for 24896@debbugs.gnu.org; Thu, 08 Dec 2016 06:12:48 -0500 Received: by mail-ua0-f171.google.com with SMTP id 12so444869497uas.2 for <24896@debbugs.gnu.org>; Thu, 08 Dec 2016 03:12:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=7lJ2tMxYosaJRD6A050aNBPNoeWkametcTpci7bURhg=; b=baoBT6nfJX903p0Of0AIqKhr/q5sWbzUHkT+DI7Pno5iGxAsi8ljS/ufBIkIo7T6Or bsHP5+37Cgp/P4Q/5q3C7miNB66E4gyurjU9kOH1D8LWXMnBmrx1o5l+SUXUFpxoVp6y ret8+Yt3YNiuNadljMyJO5EEHOGQWseDkbSipQs5zCNY4ZUIrVOlOOzutynbJ9N/9rNt YWX/NRhUbM62qK3Chc1eSrr6nFs7WvWs35B+6MC4IoEIWnnprbX58gitqx33BsoOYolq FWm842ZlgKUamNZx7NkYbq6kmFXjTqSgRN2uBOIUA24JlUyMmBuir4wV/cUKHL94n8N3 vIcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=7lJ2tMxYosaJRD6A050aNBPNoeWkametcTpci7bURhg=; b=ZoMA7jKlxxZBl08dxG2xiAJ1XBBFQkSlwALFGnNBebF6V1QmOIvv6MPM0Txa2xpWSg r4VmBU/P9UA1sNMxJiSrZ1RfGyaD4yoT20Ghx3MeO4LEN1lVvl+YmpYcj07XAgkvPvNy KUtWV+b0Akbi50xNG1r/H55ClhD3PYsdiWMFawqJ8y/DFMmky94IXQzJBn9Pn7ztOZNc 48B690TwXCQ0fS7kNXQEzv2bOyLS+pmStPoqttl9Nr9wzogJrumOwG2cvj2qSW/Us354 9XeaxQSNNFICQebbIufGGVFz7+IpKw0425rk6qeR6yepmUPJY4UxBmLZhLjFytwk+6bV hT8A== X-Gm-Message-State: AKaTC01f/zO8EUSc63NCJpTUps/MW/7NHETUn8KgCfqt6vBz1wr29EPTFJj8sjUjvtJY3AttXZFL93E7hpquFA== X-Received: by 10.176.3.86 with SMTP id 80mr57906913uat.157.1481195562682; Thu, 08 Dec 2016 03:12:42 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.85.156 with HTTP; Thu, 8 Dec 2016 03:12:42 -0800 (PST) In-Reply-To: References: <6d48deda-1d14-2d50-ca86-c89f35bf37db@yandex.ru> <77f1f91d-2f8c-0509-7a16-50bae68f3883@jacksonrayhamilton.com> From: Felipe Ochoa Date: Thu, 8 Dec 2016 12:12:42 +0100 Message-ID: Subject: Re: bug#24896: JSX prop indentation after fat arrow To: 24896@debbugs.gnu.org, Dmitry Gutov Content-Type: multipart/alternative; boundary=001a113d67e45b4d63054323b768 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 24896 Cc: Jackson Ray Hamilton 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.0 (/) --001a113d67e45b4d63054323b768 Content-Type: text/plain; charset=UTF-8 Thanks -- seems reasonable. I figured as much but wanted to confirm. I wonder what could be done in js-mode, too. A syntax-propertize-function > rule, maybe. > syntax-propertize-function is outside my limited knowledge of emacs internals. But to the extent that one could say "Outside of comments and strings, propertize `=>' as punctuation," I imagine that would fix it. Also, this may be a dumb question, but are the tests in the "manual" directory meant to be run manually? If not, how would I run the tests there? And then finally, should I just email a patch with the proposed change & tests for this? > (Sorry Jackson for the double email -- forgot to reply all) --001a113d67e45b4d63054323b768 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks -- seems reasonable. I figured as much but wanted = to confirm.

I wonder what could be done in js-mode, too. A syntax-propertiz= e-function rule, maybe.

syntax-propertize-= function is outside my limited knowledge of emacs internals. But to the ext= ent that one could say "Outside of comments and strings, propertize `= =3D>' as punctuation," I imagine that would fix it.

Also, this may be a dumb question, but are the tests in the "man= ual" directory meant to be run manually? If not, how would I run the t= ests there?

And then finally, should I just email a patch with the proposed change = & tests for this?


(Sorry Jackson = for the double email -- forgot to reply all)
--001a113d67e45b4d63054323b768-- From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 08 19:18:23 2016 Received: (at 24896) by debbugs.gnu.org; 9 Dec 2016 00:18:23 +0000 Received: from localhost ([127.0.0.1]:34981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cF8tK-0001Ov-Fv for submit@debbugs.gnu.org; Thu, 08 Dec 2016 19:18:23 -0500 Received: from mail-wj0-f174.google.com ([209.85.210.174]:34332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cF8tI-0001Oi-Ba for 24896@debbugs.gnu.org; Thu, 08 Dec 2016 19:18:21 -0500 Received: by mail-wj0-f174.google.com with SMTP id tg4so1801121wjb.1 for <24896@debbugs.gnu.org>; Thu, 08 Dec 2016 16:18:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=MvFTbpkLB7T6Tu51ALOWbG3+/S6EgGhWtjeJ/o0UpR8=; b=YFbfBWQws85SfNJZ5lZT0UXx3s9OfByHXbTKuEjFbXCpPgjd3u9kq2+KBJVA9ZaSKe km8u9Y5YNUMVNqIvlUiZ9yBLvPlFiPhN2JkQYpQYoCyTfZNr27esHzqyHKTmk0NwR5NR 8hqw4Ip87kqI8u+26h6EQ8I+D0M6U1G1etp/N0tWrYwOCWhPS61O7MT9tK2XGsOTd+mV mfpXUzWyX09fpATB9rWwfpgFUPd1Ip+6WGhlJwoHNPiYDy6PERFKYcxz5WsGZptHEkIM L49tbMZ1rOcsYZ6Ek+MnjLow047fH97XIBBHn59kTHFALuNIgaqN8Em/0bT2ZPDLRb1W tmVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=MvFTbpkLB7T6Tu51ALOWbG3+/S6EgGhWtjeJ/o0UpR8=; b=Onfhxp2LtX0HOmBN1fYtUxCE4yZ/5yBTJlk/OWKO1rOHYenomdo8B8+AX+EzfYcQiq csermx+WqbSmZrHdcn2vSMZzL7YOZuHs6OYp3uohGt/JMqLr9zC3RNmgWygsu1iL4D+S b7HJ59RrQkvdBRUtSJdbf31xHH6nsIIyWgGsJqIQOFuw2VKX2c2u2Iy4t6ua/Uf41wn1 zvHjgq1aq09wQ0Zd+vgJj/gNXU3WQkPzv/nJz80pBWVAymHRduhov/FlmJli8sjykpkd WvljzqUpzXp6BdwIgkMdWnuvSAeUQyJq4krJacwPTx5ZR4tTL77VbfGMuwgR9vjJsOSp yxJA== X-Gm-Message-State: AKaTC03klgHfbCmaM7cKWE8ej5SWXZ+MadaN85OfxaJrXZG06W+NEVIDVQDCGPZ/pTu8gA== X-Received: by 10.194.108.10 with SMTP id hg10mr79382926wjb.58.1481242694555; Thu, 08 Dec 2016 16:18:14 -0800 (PST) Received: from [192.168.1.3] ([185.105.173.41]) by smtp.googlemail.com with ESMTPSA id l2sm39532369wji.7.2016.12.08.16.18.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Dec 2016 16:18:13 -0800 (PST) Subject: Re: bug#24896: JSX prop indentation after fat arrow To: Felipe Ochoa , 24896@debbugs.gnu.org References: <6d48deda-1d14-2d50-ca86-c89f35bf37db@yandex.ru> <77f1f91d-2f8c-0509-7a16-50bae68f3883@jacksonrayhamilton.com> From: Dmitry Gutov Message-ID: <447f307f-e226-e6a5-f62a-88bcdcda74df@yandex.ru> Date: Fri, 9 Dec 2016 02:18:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 24896 Cc: Jackson Ray Hamilton 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.0 (/) On 08.12.2016 13:12, Felipe Ochoa wrote: > syntax-propertize-function is outside my limited knowledge of emacs > internals. But to the extent that one could say "Outside of comments and > strings, propertize `=>' as punctuation," I imagine that would fix it. Yes, it can help with that. > Also, this may be a dumb question, but are the tests in the "manual" > directory meant to be run manually? If not, how would I run the tests there? You can e.g. 'cd test/manual/indent' and run 'make js-jsx.js.test', to compare the indentation in js-jsx.js against what the current js.el does. > And then finally, should I just email a patch with the proposed change & > tests for this? An email with a diff attached could be enough. But if you wanted to include a "proper" commit message as well, see CONTRIBUTE in the top directory. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 06 12:44:52 2017 Received: (at 24896) by debbugs.gnu.org; 6 Jan 2017 17:44:52 +0000 Received: from localhost ([127.0.0.1]:45353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cPYZQ-0002Br-02 for submit@debbugs.gnu.org; Fri, 06 Jan 2017 12:44:52 -0500 Received: from mail-ua0-f176.google.com ([209.85.217.176]:33663) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cPYZN-0002Be-Np for 24896@debbugs.gnu.org; Fri, 06 Jan 2017 12:44:50 -0500 Received: by mail-ua0-f176.google.com with SMTP id i68so307987706uad.0 for <24896@debbugs.gnu.org>; Fri, 06 Jan 2017 09:44:49 -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 :cc; bh=GR1z6y94b0MRwhbXuiy6JascDfLC4B4vrOXwA12bQjk=; b=B1eupi4CZbLoBeMBiqxJLvML4qKLX2nZUc0M2+xCRVfPMtS7LuUHo1TvVLTvBEUCTw kj+M6bgXvHUHHBydlOquNCluyu+mOsvstQt9wFSnBoRIzfaHi6JGH76FA23a2Jwu79bp EaGaxIce6ok3NHuBcbQcRk5RGvMDpsn9CEQeRrRM7cehBTjKavG5pyxeXY6sXe18Wv9J 25IBFaDUX481pLwa/EzUHLcrbuFUnDrKkNoPhAriCnDWXCkRUOod5fCQLAnTIZYEqW1K oo34XPos42cRGqSIOLmIpLkUpoGWLuiLs/FVMLQLgbXnUMTz7/V+FCukpAxAvNmyhVRN cUKg== 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:cc; bh=GR1z6y94b0MRwhbXuiy6JascDfLC4B4vrOXwA12bQjk=; b=AcxgujeeOXM5tAZJbRQOENBf/D1IYkwg+aIqiLjm8qvf2g0AVrSNHO9/jjEbh8phD7 z55gU4N1YiBdaNThXYDHRWS9/g/06iLtcw+q4ONgWnjQiFCDkQTOOEORbyo/C1dnFufV 1b0XxsWneDHx/oyt7hJNmDTccgxRQ++XNGpSk/+JZ2PLR0N+SYP/39PFb3IVEQ/Hwlm7 6/7koBO/o0LeZJUHvURwmGyRhHBecDwjXYTcY//acBVD00NqSvkVyRS64ogfNaKykMht yTJOImXXDm80ZRsvBd/bKXYQ4Vi31rhEXt+Vr+VlYlc2wovvwjSwqZtKiz4lPSdMPX6L l0nA== X-Gm-Message-State: AIkVDXJzkaZJfuGE3ZZUuwvVUbEn1Unsh6ktPnG7A1Y/s3HfgXwLUe97DVb1XQlliQBa6CE1+5Py3m1Z0X18VQ== X-Received: by 10.159.34.111 with SMTP id 102mr5811875uad.160.1483724683831; Fri, 06 Jan 2017 09:44:43 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.74.85 with HTTP; Fri, 6 Jan 2017 09:44:43 -0800 (PST) In-Reply-To: <447f307f-e226-e6a5-f62a-88bcdcda74df@yandex.ru> References: <6d48deda-1d14-2d50-ca86-c89f35bf37db@yandex.ru> <77f1f91d-2f8c-0509-7a16-50bae68f3883@jacksonrayhamilton.com> <447f307f-e226-e6a5-f62a-88bcdcda74df@yandex.ru> From: Felipe Ochoa Date: Fri, 6 Jan 2017 18:44:43 +0100 Message-ID: Subject: Re: bug#24896: JSX prop indentation after fat arrow To: Dmitry Gutov Content-Type: multipart/alternative; boundary=001a1135be2cb96f740545709214 X-Spam-Score: -0.6 (/) X-Debbugs-Envelope-To: 24896 Cc: 24896@debbugs.gnu.org, Jackson Ray Hamilton 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.6 (/) --001a1135be2cb96f740545709214 Content-Type: text/plain; charset=UTF-8 So I've thought about this some more, and realized that this won't fix everything. There are still issues with greater-than and less-than as binary operators. Maybe a better idea is to give '{' and '}' comment syntax ('<' and '>') so that SGML ignores all the bracketed JS stuff. I've been trialing this with the following: (defvar js-jsx-tag-syntax-table (let ((table (make-syntax-table sgml-tag-syntax-table))) (modify-syntax-entry ?\{ "<" table) (modify-syntax-entry ?\} ">" table) table)) (defun advice-js-jsx-indent-line (orig-fun) (interactive) (let ((sgml-tag-syntax-table js-jsx-tag-syntax-table)) (apply orig-fun nil))) (advice-add 'js-jsx-indent-line :around 'advice-js-jsx-indent-line) and have gotten good results so far. This works for js-mode and js2-mode. If you're both happy with this approach, I'll convert the advice into a patch for `js-jsx-indent-line' and will send along! On Fri, Dec 9, 2016 at 1:18 AM, Dmitry Gutov wrote: > On 08.12.2016 13:12, Felipe Ochoa wrote: > > syntax-propertize-function is outside my limited knowledge of emacs >> internals. But to the extent that one could say "Outside of comments and >> strings, propertize `=>' as punctuation," I imagine that would fix it. >> > > Yes, it can help with that. > > Also, this may be a dumb question, but are the tests in the "manual" >> directory meant to be run manually? If not, how would I run the tests >> there? >> > > You can e.g. 'cd test/manual/indent' and run 'make js-jsx.js.test', to > compare the indentation in js-jsx.js against what the current js.el does. > > And then finally, should I just email a patch with the proposed change & >> tests for this? >> > > An email with a diff attached could be enough. > > But if you wanted to include a "proper" commit message as well, see > CONTRIBUTE in the top directory. > --001a1135be2cb96f740545709214 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
So I've thought about this some more, and realize= d that this won't fix everything. There are still issues with greater-t= han and less-than as binary operators. Maybe a better idea is to give '= {' and '}' comment syntax ('<' and '>') s= o that SGML ignores all the bracketed JS stuff. I've been trialing this= with the following:

(defvar js-jsx-tag-syntax-table
=C2=A0 (let = ((table (make-syntax-table sgml-tag-syntax-table)))
=C2=A0=C2=A0=C2=A0 (= modify-syntax-entry ?\{ "<" table)
=C2=A0=C2=A0=C2=A0 (modi= fy-syntax-entry ?\} ">" table)
=C2=A0=C2=A0=C2=A0 table))
(defun advice-js-jsx-indent-line (orig-fun)
=C2=A0 (interactive)=C2=A0 (let ((sgml-tag-syntax-table js-jsx-tag-syntax-table))
=C2=A0= =C2=A0=C2=A0 (apply orig-fun nil)))

(advice-add 'js-jsx-indent-l= ine :around 'advice-js-jsx-indent-line)

and have gotten go= od results so far. This works for js-mode and js2-mode. If you're both = happy with this approach, I'll convert the advice into a patch for `js-= jsx-indent-line' and will send along!


On Fri, Dec 9, 2016 at 1:1= 8 AM, Dmitry Gutov <dgutov@yandex.ru> wrote:
On 08.12.2016 13:12, Felipe Ochoa wrote:=

syntax-propertize-function is outside my limited knowledge of emacs
internals. But to the extent that one could say "Outside of comments a= nd
strings, propertize `=3D>' as punctuation," I imagine that woul= d fix it.

Yes, it can help with that.

Also, this may be a dumb question, but are the tests in the "manual&qu= ot;
directory meant to be run manually? If not, how would I run the tests there= ?

You can e.g. 'cd test/manual/indent' and run 'make js-jsx.js.te= st', to compare the indentation in js-jsx.js against what the current j= s.el does.

And then finally, should I just email a patch with the proposed change &= ;
tests for this?

An email with a diff attached could be enough.

But if you wanted to include a "proper" commit message as well, s= ee CONTRIBUTE in the top directory.

--001a1135be2cb96f740545709214-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 14 21:05:02 2017 Received: (at 24896) by debbugs.gnu.org; 15 Jan 2017 02:05:02 +0000 Received: from localhost ([127.0.0.1]:54288 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cSaBq-00059m-4h for submit@debbugs.gnu.org; Sat, 14 Jan 2017 21:05:02 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:33828) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cSaBo-00059Q-Ho for 24896@debbugs.gnu.org; Sat, 14 Jan 2017 21:05:01 -0500 Received: by mail-lf0-f68.google.com with SMTP id q89so9232600lfi.1 for <24896@debbugs.gnu.org>; Sat, 14 Jan 2017 18:05:00 -0800 (PST) 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=/QIAX4tC4v0RHaKrwZLdPpo7AAYUWcI9YJg66Uqx4mk=; b=prZorZ3MyGKbBC8pXNHScTXv81FDylaVBi0Xlq5pk0ibr2jF3LLQ9Vpl/b4YQhZ6hW pBiGh8X0jo9xDB6vd720J3Wn/2kV/NPDOJJQNQQ5TiVDdzsHsoJqbktjgFHbv6E0lKJ/ puGI5zCw9IRpvPV/HNmt3f7VDO4qgIKLEdSim7x5h+XRb1+AIk0Wy/5gEyacbCLdp3pf dKjFnTAa/nYe+9P6FUOW5q/TYDm0vdJTkPjdtV953D30SzQFwcsvoCHlwMSfD8qe8LUq az7eXsX/AYFNjetY9+/MwRvyTlp7sZnr4TtWKzmSB9yrVdZkHCwAzUejHyOvzCzGGn6L DpDA== 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=/QIAX4tC4v0RHaKrwZLdPpo7AAYUWcI9YJg66Uqx4mk=; b=gUi4VbG1rTYOiignK5wW85NMTwHFXZ9zbuymdm6IN4xbvUIdgYZd1OcyqWdSa6Bxz2 bxLcOK8lCh8ASwa7rkoWj5eRgptNz+OsaibKZZ0jodGN7tKGhxVIHSJym+8/B6Js4JWT BUgqil7lcM3zgTNsi8Kz3Bb0XBOhnLqVzAoIXZQwrIgZ7wt5vFWdmufmlqVLF95uMAGe PSSZy/8WyeJuBSZuE7YA1sganPuYBb3dfqirx0DFK2xygSetqUgNkL3WU5BzG2Udrnfz WqF0VjFeBxld1lOATLjEcJZ0/hawjktRlPJh0wK1YSbZGLQUE8ALNEtorEtIreFByW4T /k0Q== X-Gm-Message-State: AIkVDXKK9tmgLH5fvCbmht74Aj6wL6N+R0T4DUkBaTEqgGLynv2xZB6hWBcXxhbLI79iGQ== X-Received: by 10.25.39.4 with SMTP id n4mr3160938lfn.0.1484445894562; Sat, 14 Jan 2017 18:04:54 -0800 (PST) Received: from [192.168.1.174] ([178.252.127.239]) by smtp.googlemail.com with ESMTPSA id k7sm5469755lfe.26.2017.01.14.18.04.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Jan 2017 18:04:53 -0800 (PST) Subject: Re: bug#24896: JSX prop indentation after fat arrow To: Felipe Ochoa References: <6d48deda-1d14-2d50-ca86-c89f35bf37db@yandex.ru> <77f1f91d-2f8c-0509-7a16-50bae68f3883@jacksonrayhamilton.com> <447f307f-e226-e6a5-f62a-88bcdcda74df@yandex.ru> From: Dmitry Gutov Message-ID: <79cc5841-8480-b2fd-eeb7-ff2bf33a0e68@yandex.ru> Date: Sun, 15 Jan 2017 05:04:51 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:51.0) Gecko/20100101 Thunderbird/51.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 4.1 (++++) 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: On 06.01.2017 20:44, Felipe Ochoa wrote: > So I've thought about this some more, and realized that this won't fix > everything. There are still issues with greater-than and less-than as > binary operators. [...] Content analysis details: (4.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (dgutov[at]yandex.ru) -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.215.68 listed in wl.mailspike.net] 3.6 RCVD_IN_SORBS_WEB RBL: SORBS: sender is an abusable web server [178.252.127.239 listed in dnsbl.sorbs.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source [209.85.215.68 listed in dnsbl.sorbs.net] 0.0 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid X-Debbugs-Envelope-To: 24896 Cc: 24896@debbugs.gnu.org, Jackson Ray Hamilton 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: 4.1 (++++) 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: On 06.01.2017 20:44, Felipe Ochoa wrote: > So I've thought about this some more, and realized that this won't fix > everything. There are still issues with greater-than and less-than as > binary operators. [...] Content analysis details: (4.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source [209.85.215.68 listed in dnsbl.sorbs.net] 3.6 RCVD_IN_SORBS_WEB RBL: SORBS: sender is an abusable web server [178.252.127.239 listed in dnsbl.sorbs.net] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.215.68 listed in wl.mailspike.net] 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (raaahh[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid On 06.01.2017 20:44, Felipe Ochoa wrote: > So I've thought about this some more, and realized that this won't fix > everything. There are still issues with greater-than and less-than as > binary operators. Inside XML literals, you mean? > Maybe a better idea is to give '{' and '}' comment > syntax ('<' and '>') so that SGML ignores all the bracketed JS stuff. > I've been trialing this with the following: How's your experience so far? > (defvar js-jsx-tag-syntax-table > (let ((table (make-syntax-table sgml-tag-syntax-table))) > (modify-syntax-entry ?\{ "<" table) > (modify-syntax-entry ?\} ">" table) > table)) > > (defun advice-js-jsx-indent-line (orig-fun) > (interactive) > (let ((sgml-tag-syntax-table js-jsx-tag-syntax-table)) > (apply orig-fun nil))) Here's the problem: js-indent-line uses syntax-ppss. sgml-indent-line doesn't (for now), but js-jsx-indent-line calls js-indent-line in certain contexts. And this is a problem because calling syntax-ppss in different contexts with incompatible (paren-wise) syntax tables will make syntax-ppss cache broken, and lead to likewise broken behaviors. So, one thing we could do here is let-bind the variables that constitute syntax-ppss cache around the call to orig-fun (i.e. around the context where we modify the syntax table). Another, somewhat more difficult approach, would be to try to apply the "<" and ">" syntax classes in syntax-propertize-function, only to occurrences of "{" and "}" inside XML literals. That would require knowing where the said literals begin and end, but we do know that somehow already, seeing as we know which indentation function to choose, right? This way we don't depend on syntax-ppss internals (the cache is not really a public API), and reindenting the whole buffer might be faster, because we would keep syntax-ppss cache around more. Still, not sure how much faster that would be in practice. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 23 11:11:06 2017 Received: (at 24896) by debbugs.gnu.org; 23 Jan 2017 16:11:06 +0000 Received: from localhost ([127.0.0.1]:39290 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cVhCz-000234-K6 for submit@debbugs.gnu.org; Mon, 23 Jan 2017 11:11:05 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:37703) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cVatD-0007Q8-UL for 24896@debbugs.gnu.org; Mon, 23 Jan 2017 04:26:16 -0500 Received: by mail-wm0-f47.google.com with SMTP id c206so144365384wme.0 for <24896@debbugs.gnu.org>; Mon, 23 Jan 2017 01:26:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-transfer-encoding:thread-index :content-language; bh=AZFO1oHp0RD0WMmjPY9G95cf8HFM9JJFMsEG+bYGHBQ=; b=CsHwhTdCZujyrv9l9NSMarY6Uvhm2a8Vg5JTBoBCr9PlflJewpsDYMw7mussrOQ7Gw BCL4sQ3TiIFsCcEHQ61zJcvWUKjJb4Dm4HjocH+DZedDCEnRV+UnKS9a5AWyON98JLsk E75/8lEAuhBzIcaRgDykuD8k3FwTuc4PcKeCypYgBjehBGMF5Cf/+nHzgBq2/4js1ajG JHn6mmnwUcX3a4myaYarFfghSWi94R1s2PWt7yGgJj7vwj5NKBHmOGqZQXSlinkrDiMO cKX9eo5TEpYhlKbuL+vtDFrTk2IZCM3NKhBjYeDnRT81Zjz65RR4Ezk899ZSNAPzPgzS fEdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:references:in-reply-to:subject:date :message-id:mime-version:content-transfer-encoding:thread-index :content-language; bh=AZFO1oHp0RD0WMmjPY9G95cf8HFM9JJFMsEG+bYGHBQ=; b=JLunhETXVm5nUpALY7g0uTy4K1KtARqCaNd98uG0rlF9L3AjSthuYGaZrJh7buCWx0 qYTJAVoOGQJeE1tjcl6x65Bj+9rLr6/BtNJwBN6rflXioHeDUFEt8TyXtGVarjB1ynmZ 09Kf5KbJ/waCCEebkZAJm5wGDQFI9BrefVzemdaJjvPnxkoQwU7ro+dLmIJdBHHzmKAQ CgGy9/rNLKqPl/5ZlKP7VRYOmfrEV82ruKBHWAg6Ix35ID0FEK/EuKQE8+Oswj3ujEGM nALLK1VwVGBlRwRmlKGTBMZQVAtwJqRm5Y+sOjusoi8G/neUGDlVj4+IsMBdryoe/Uyn lfBQ== X-Gm-Message-State: AIkVDXLAsIkdM7aUXzIvMt9TY6STilj0AsOlIlJSiBOlBa87LEouhIzUPXt0AFdwqnMUDQ== X-Received: by 10.28.62.144 with SMTP id l138mr12141228wma.50.1485163569855; Mon, 23 Jan 2017 01:26:09 -0800 (PST) Received: from DESKTOP0SBUG2I (i32174.upc-i.chello.nl. [62.195.32.174]) by smtp.gmail.com with ESMTPSA id 36sm13547844wrz.8.2017.01.23.01.26.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jan 2017 01:26:09 -0800 (PST) From: "Felipe Ochoa" To: "'Dmitry Gutov'" , "'Felipe Ochoa'" References: <6d48deda-1d14-2d50-ca86-c89f35bf37db@yandex.ru> <77f1f91d-2f8c-0509-7a16-50bae68f3883@jacksonrayhamilton.com> <447f307f-e226-e6a5-f62a-88bcdcda74df@yandex.ru> <79cc5841-8480-b2fd-eeb7-ff2bf33a0e68@yandex.ru> In-Reply-To: <79cc5841-8480-b2fd-eeb7-ff2bf33a0e68@yandex.ru> Subject: RE: bug#24896: JSX prop indentation after fat arrow Date: Mon, 23 Jan 2017 10:26:06 +0100 Message-ID: <004301d2755a$b9f62b30$2de28190$@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQImPQmOIF2vTGk0Xpwdmvzo8VZGvgK6MS7SArjuQ1ICjxCMUgKiBYpFAak6C6wB5+aSaQFv/gwsoBYcKOA= Content-Language: en-us X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 24896 X-Mailman-Approved-At: Mon, 23 Jan 2017 11:11:05 -0500 Cc: 24896@debbugs.gnu.org, 'Jackson Ray Hamilton' 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.7 (/) >> There are still issues with greater-than and less-than=20 >> as binary operators. > Inside XML literals, you mean? Yes, exactly. > How's your experience so far? It's actually worked very well. I had an issue once where indenting an = entire region took several passes to get right, but now I'm not able to = reproduce it :(=20 > Here's the problem: js-indent-line uses syntax-ppss.=20 > sgml-indent-line doesn't (for now), but js-jsx-indent-line=20 > calls js-indent-line in certain contexts. And this is a problem > because calling syntax-ppss in different contexts with=20 > incompatible (paren-wise) syntax tables will make=20 > syntax-ppss cache broken, and lead to likewise broken > behaviors. I'm not sure I'm grasping this part entirely. I understand conceptually = that using syntax-ppss with incompatible syntax tables could lead to = cache problems. But it seems to me that the js*-mode and sgml-*-mode = syntax tables are already incompatible (namely, "<" and ">", which are = causing all this grief!). Would introducing this additional = incompatibility cause more problems?=20 > So, one thing we could do here is let-bind the variables that=20 > constitute syntax-ppss cache around the call to orig-fun=20 > (i.e. around the context where we modify the syntax table). > ... (the cache is not really a public API) This sounds like a bit of a headache. E.g., indenting a region would = require binding and unbinding the cache carefully as you stepped into = and out of JSX. What if we just scrap the syntax-ppss cache altogether? = Would the performance penalty be too great? > Another, somewhat more difficult approach, would be to try > to apply the "<" and ">" syntax classes in=20 > syntax-propertize-function, only to occurrences of "{" and "}"=20 > inside XML literals. That would require knowing where the said > literals begin and end, but we do know that somehow already, > seeing as we know which indentation function to choose, right? This is based on a rough heuristic that essentially backtracks looking = for "[(,]\n *<" (it also handles comments). This misses any JSX which is = not at the start of the line, and it only tells us the start of the tag, = not the end or where the body ends. In js2 and rjsx there is of course = the full parser to give us this information.=20 > This way we don't depend on syntax-ppss internals, and reindenting > the whole buffer might be faster, because we would keep syntax-ppss=20 > cache around more. Still, not sure how much faster that would be in=20 > practice. I think we could use a regex like the following to identify JSX start = tokens: (rx (seq (or (any "-+*/%=3D>" = that close JSX tags: (rx (seq ">" (* whitespace) ; Should also skip over comments (or (any "-+*/%=3D>) id 1cVi5a-0003OK-HK for submit@debbugs.gnu.org; Mon, 23 Jan 2017 12:07:30 -0500 Received: from mta-05-3.privateemail.com ([68.65.122.15]:59867) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cVi5X-0003O3-C0 for 24896@debbugs.gnu.org; Mon, 23 Jan 2017 12:07:28 -0500 Received: from [10.0.0.16] (unknown [10.20.151.244]) by MTA-05.privateemail.com (Postfix) with ESMTPA id 654D860040; Mon, 23 Jan 2017 17:07:18 +0000 (UTC) Subject: Re: bug#24896: JSX prop indentation after fat arrow To: Felipe Ochoa , 'Dmitry Gutov' , 'Felipe Ochoa' References: <6d48deda-1d14-2d50-ca86-c89f35bf37db@yandex.ru> <77f1f91d-2f8c-0509-7a16-50bae68f3883@jacksonrayhamilton.com> <447f307f-e226-e6a5-f62a-88bcdcda74df@yandex.ru> <79cc5841-8480-b2fd-eeb7-ff2bf33a0e68@yandex.ru> <004301d2755a$b9f62b30$2de28190$@gmail.com> From: Jackson Ray Hamilton X-Enigmail-Draft-Status: N1110 Message-ID: <5efb9de2-47cb-3843-1521-9252e1a49005@jacksonrayhamilton.com> Date: Mon, 23 Jan 2017 09:07:17 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.5.1 MIME-Version: 1.0 In-Reply-To: <004301d2755a$b9f62b30$2de28190$@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 24896 Cc: 24896@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.0 (/) Hi Felipe, Regarding, > This is based on a rough heuristic that essentially backtracks looking for "[(,]\n *<" (it also handles comments). This misses any JSX which is not at the start of the line, and it only tells us the start of the tag, not the end or where the body ends. In js2 and rjsx there is of course the full parser to give us this information. Please note Dmitry's comment: https://github.com/mooz/js2-mode/issues/140#issuecomment-40887172, > As for indentation . . . there's a question how one would determine whether point is inside an XML expression (and expression's bounds) without using the AST (using it was rejected in the past on the grounds of that being slow). And see here for my explanation of that design: https://github.com/mooz/js2-mode/issues/140#issuecomment-145325361 Feel free the improve upon this algorithm, although do take care to benchmark the code before and after your changes, with buffers of various sizes. Large files won't hold up well if using an AST for indentation. Probably better to extend the current heuristic to be more accurate. Jackson On 01/23/2017 01:26 AM, Felipe Ochoa wrote: >>> There are still issues with greater-than and less-than >>> as binary operators. >> Inside XML literals, you mean? > > Yes, exactly. > >> How's your experience so far? > > It's actually worked very well. I had an issue once where indenting an entire region took several passes to get right, but now I'm not able to reproduce it :( > >> Here's the problem: js-indent-line uses syntax-ppss. >> sgml-indent-line doesn't (for now), but js-jsx-indent-line >> calls js-indent-line in certain contexts. And this is a problem >> because calling syntax-ppss in different contexts with >> incompatible (paren-wise) syntax tables will make >> syntax-ppss cache broken, and lead to likewise broken >> behaviors. > > I'm not sure I'm grasping this part entirely. I understand conceptually that using syntax-ppss with incompatible syntax tables could lead to cache problems. But it seems to me that the js*-mode and sgml-*-mode syntax tables are already incompatible (namely, "<" and ">", which are causing all this grief!). Would introducing this additional incompatibility cause more problems? > >> So, one thing we could do here is let-bind the variables that >> constitute syntax-ppss cache around the call to orig-fun >> (i.e. around the context where we modify the syntax table). >> ... (the cache is not really a public API) > > This sounds like a bit of a headache. E.g., indenting a region would require binding and unbinding the cache carefully as you stepped into and out of JSX. What if we just scrap the syntax-ppss cache altogether? Would the performance penalty be too great? > >> Another, somewhat more difficult approach, would be to try >> to apply the "<" and ">" syntax classes in >> syntax-propertize-function, only to occurrences of "{" and "}" >> inside XML literals. That would require knowing where the said >> literals begin and end, but we do know that somehow already, >> seeing as we know which indentation function to choose, right? > > This is based on a rough heuristic that essentially backtracks looking for "[(,]\n *<" (it also handles comments). This misses any JSX which is not at the start of the line, and it only tells us the start of the tag, not the end or where the body ends. In js2 and rjsx there is of course the full parser to give us this information. > >> This way we don't depend on syntax-ppss internals, and reindenting >> the whole buffer might be faster, because we would keep syntax-ppss >> cache around more. Still, not sure how much faster that would be in >> practice. > > I think we could use a regex like the following to identify JSX start tokens: > > (rx (seq (or (any "-+*/%=> (seq (or "return" "typeof" "delete" "instanceof") whitespace) > (any "([{,;")) > (* whitespace) ; Should also skip over comments > "<")) > > I.e., any "<" after an operator or at the beginning of an expression or statement. We'd have to filter out some false positives (postfix ++ and --, strings, and comments, possibly others), but this would get all the JSX start tags, I think. We could use a similar regex to find the ">" that close JSX tags: > > (rx (seq ">" > (* whitespace) ; Should also skip over comments > (or (any "-+*/%=> (seq (or "return" "typeof" "delete" "instanceof") whitespace) > (any "(}],;")) > > Not sure how to go from there to the "{" and "}" tokens though. Is it possible to run syntax-ppss using different tables for different parts of the buffer? > From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 24 21:00:09 2017 Received: (at 24896) by debbugs.gnu.org; 25 Jan 2017 02:00:09 +0000 Received: from localhost ([127.0.0.1]:41227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWCsb-0007tK-Eu for submit@debbugs.gnu.org; Tue, 24 Jan 2017 21:00:09 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:36647) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWCsa-0007sJ-EK for 24896@debbugs.gnu.org; Tue, 24 Jan 2017 21:00:08 -0500 Received: by mail-lf0-f65.google.com with SMTP id h65so19035614lfi.3 for <24896@debbugs.gnu.org>; Tue, 24 Jan 2017 18:00:08 -0800 (PST) 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=uVzS70GzwFc+rYYLHhgCNjDmSH5IwIr7YZzBbQchUM4=; b=LMLp1eQsmE7PRX9W+t76KxX3/Dio1BEAUvf8SYP7jUAbsZOPhZxzPrYrfPii/aSzOa znkTx4I06BgWX3b0LbRZHwv7jj9bprSzaI/UGjQ9f3U2ppAhlH2mMwY8W1mxlT2Rc21v LWfJ8+WQuME4wSh13Lnalzowya2InCLndpCIDuHBBikUAK00Nq3ERLT92XhVCZO1Dlff xjeSbpKVa3Wqb9BYhFLNWhZ8Ru+WS8qPUfiqppomArGe/Q9ejk20B3zpZ0ze+5AHRHig wR2NnuMYS5Rxakwo1MxBagvplNmU/rfEolX4z0g2LIYoQOSnaqKxWn59g3p+zvY61Vrn ZKcg== 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=uVzS70GzwFc+rYYLHhgCNjDmSH5IwIr7YZzBbQchUM4=; b=jCeBgs3DQ+tFOtKCM01tALCjACTcQXptrxr+SMyEIDoliPCUWtZyzRf0Fg0ZuKOf4/ 2RMASJ1gIT+S9pIqNJ8rUQSKabVgGS+aPH6BODI7Sl0Hk1SWu6gUIRGDbq5sARM4bytc MQYImigmIqq/omi4XGZuBIYpn1UzCCLQbuwEhRVqRa8TY2aEifbkEWL8ziuPwFj/OeUI s3pSSsWMqXwH/XdQv9pOJ/aOMjwy2Q9+J0KjXU0/BG7dam3XLl/yBRUBlqTox84Qan1K mLmLAvTlLZVSToK2SOvZ1/9R9TSyKqfniwaIY+yngk+M7W4A60eG+EfItdHcI9LwvvA9 PQsA== X-Gm-Message-State: AIkVDXJMwlJyDByABMe7Vq8XzFxJS3rnO/qu5/ceXDnu6otCdpGfcKVoJ2v2oguINHxqDQ== X-Received: by 10.25.33.21 with SMTP id h21mr10767109lfh.114.1485309601347; Tue, 24 Jan 2017 18:00:01 -0800 (PST) Received: from [192.168.1.174] ([178.252.127.239]) by smtp.googlemail.com with ESMTPSA id n20sm7921989lfn.5.2017.01.24.17.59.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jan 2017 18:00:00 -0800 (PST) Subject: Re: bug#24896: JSX prop indentation after fat arrow To: 'Felipe Ochoa' References: <6d48deda-1d14-2d50-ca86-c89f35bf37db@yandex.ru> <77f1f91d-2f8c-0509-7a16-50bae68f3883@jacksonrayhamilton.com> <447f307f-e226-e6a5-f62a-88bcdcda74df@yandex.ru> <79cc5841-8480-b2fd-eeb7-ff2bf33a0e68@yandex.ru> <004301d2755a$b9f62b30$2de28190$@gmail.com> From: Dmitry Gutov Message-ID: <7c472ad4-7a80-3747-3661-3dcdafce2c04@yandex.ru> Date: Wed, 25 Jan 2017 04:59:59 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:51.0) Gecko/20100101 Thunderbird/51.0 MIME-Version: 1.0 In-Reply-To: <004301d2755a$b9f62b30$2de28190$@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 4.1 (++++) 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: On 23.01.2017 12:26, Felipe Ochoa wrote: > It's actually worked very well. I had an issue once where indenting an entire region took several passes to get right, but now I'm not able to reproduce it :( [...] Content analysis details: (4.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source [209.85.215.65 listed in dnsbl.sorbs.net] -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 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 3.6 RCVD_IN_SORBS_WEB RBL: SORBS: sender is an abusable web server [178.252.127.239 listed in dnsbl.sorbs.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.215.65 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.215.65 listed in wl.mailspike.net] 0.0 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Debbugs-Envelope-To: 24896 Cc: 24896@debbugs.gnu.org, 'Jackson Ray Hamilton' 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: 4.1 (++++) 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: On 23.01.2017 12:26, Felipe Ochoa wrote: > It's actually worked very well. I had an issue once where indenting an entire region took several passes to get right, but now I'm not able to reproduce it :( [...] Content analysis details: (4.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source [209.85.215.65 listed in dnsbl.sorbs.net] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.215.65 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.215.65 listed in list.dnswl.org] 3.6 RCVD_IN_SORBS_WEB RBL: SORBS: sender is an abusable web server [178.252.127.239 listed in dnsbl.sorbs.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (raaahh[at]gmail.com) 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders On 23.01.2017 12:26, Felipe Ochoa wrote: > It's actually worked very well. I had an issue once where indenting an entire region took several passes to get right, but now I'm not able to reproduce it :( Unreproducible wonky behavior might be the result of busting syntax-ppss cache. > But it seems to me that the js*-mode and sgml-*-mode syntax tables are already incompatible (namely, "<" and ">", which are causing all this grief!). Right. For now, we seem to have avoided the problem because sgml-indent-line does not call syntax-ppss. > Would introducing this additional incompatibility cause more problems? ...so if you change the syntax table just around the call to sgml-calculate-indent (not the whole js-jsx-indent-line), it shouldn't make things worse. > This sounds like a bit of a headache. E.g., indenting a region would require binding and unbinding the cache carefully as you stepped into and out of JSX. What if we just scrap the syntax-ppss cache altogether? Would the performance penalty be too great? Let-binding the cache variables to nil around the call to sgml-calculate-indent might be fast enough, because multiple calls to syntax-ppss (if any) inside that functions will still be amortized. But this is really going to be more useful when sgml-calculate-indent starts using syntax-ppss, which really might never happen. So the previous solution (changing the syntax table only where needed) might be preferable in the meantime. > This is based on a rough heuristic that essentially backtracks looking for "[(,]\n *<" (it also handles comments). This misses any JSX which is not at the start of the line, and it only tells us the start of the tag, not the end or where the body ends. I think sgml-skip-tag-forward could help with the last one. > In js2 and rjsx there is of course the full parser to give us this information. Like Jackson mentioned, probably not a good idea. > I think we could use a regex like the following to identify JSX start tokens: > > (rx (seq (or (any "-+*/%=>) be realistically expected before a JSX literal? And it seems like the << operator would cause a false positive. I like the general direction, though. > We could use a similar regex to find the ">" that close JSX tags: sgml-skip-tag-forward seems like the more reliable option to me. Although it might work worse on invalid code. > Is it possible to run syntax-ppss using different tables for different parts of the buffer? If you perform the previously mentioned cache fiddling, yes. If not, then the answer is maybe, and that depends on how and when you'll be calling it. So maybe you should get into the underlying mechanics first. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 06 12:40:53 2017 Received: (at control) by debbugs.gnu.org; 6 Mar 2017 17:40:53 +0000 Received: from localhost ([127.0.0.1]:43048 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ckwcu-0001MR-ML for submit@debbugs.gnu.org; Mon, 06 Mar 2017 12:40:53 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56538) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ckwct-0001M9-2w for control@debbugs.gnu.org; Mon, 06 Mar 2017 12:40:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ckwcm-0001QQ-TK for control@debbugs.gnu.org; Mon, 06 Mar 2017 12:40:45 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50911) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ckwcm-0001QL-Pi for control@debbugs.gnu.org; Mon, 06 Mar 2017 12:40:44 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1ckwcm-0004dT-ED for control@debbugs.gnu.org; Mon, 06 Mar 2017 12:40:44 -0500 Subject: control message for bug 26001 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Mon, 06 Mar 2017 12:40:44 -0500 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: control 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: -5.0 (-----) forcemerge 24896 26001 From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 22 20:54:10 2018 Received: (at control) by debbugs.gnu.org; 23 Jan 2018 01:54:10 +0000 Received: from localhost ([127.0.0.1]:38854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ednms-0000K1-1z for submit@debbugs.gnu.org; Mon, 22 Jan 2018 20:54:10 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55925) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ednmo-0000Ji-Vy for control@debbugs.gnu.org; Mon, 22 Jan 2018 20:54:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ednmj-000262-3F for control@debbugs.gnu.org; Mon, 22 Jan 2018 20:54:01 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47754) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ednmi-00025d-Vg for control@debbugs.gnu.org; Mon, 22 Jan 2018 20:54:01 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1ednmi-0005br-Om for control@debbugs.gnu.org; Mon, 22 Jan 2018 20:54:00 -0500 Subject: control message for bug 30225 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Mon, 22 Jan 2018 20:54:00 -0500 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: control 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: -5.0 (-----) forcemerge 24896 30225 From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 14 12:19:42 2018 Received: (at control) by debbugs.gnu.org; 14 Jul 2018 16:19:42 +0000 Received: from localhost ([127.0.0.1]:60256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1feNGn-0006n5-Te for submit@debbugs.gnu.org; Sat, 14 Jul 2018 12:19:42 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40778) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1feNGm-0006mu-NR for control@debbugs.gnu.org; Sat, 14 Jul 2018 12:19:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1feNGg-0001rB-KW for control@debbugs.gnu.org; Sat, 14 Jul 2018 12:19:35 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44509) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1feNGg-0001r7-Gg for control@debbugs.gnu.org; Sat, 14 Jul 2018 12:19:34 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1feNGg-0004TU-8A for control@debbugs.gnu.org; Sat, 14 Jul 2018 12:19:34 -0400 Subject: control message for bug 32158 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Sat, 14 Jul 2018 12:19:34 -0400 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: control 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: -6.0 (------) forcemerge 24896 32158 From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 04 22:47:35 2019 Received: (at 24896) by debbugs.gnu.org; 5 Jun 2019 02:47:35 +0000 Received: from localhost ([127.0.0.1]:46207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hYLxc-0007gn-AM for submit@debbugs.gnu.org; Tue, 04 Jun 2019 22:47:35 -0400 Received: from mta-09-4.privateemail.com ([68.65.122.29]:21746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hYLxX-0007gX-Ew for 24896@debbugs.gnu.org; Tue, 04 Jun 2019 22:47:28 -0400 Received: from MTA-09.privateemail.com (localhost [127.0.0.1]) by MTA-09.privateemail.com (Postfix) with ESMTP id 8852460041 for <24896@debbugs.gnu.org>; Tue, 4 Jun 2019 22:47:21 -0400 (EDT) Received: from [192.168.88.227] (unknown [10.20.151.200]) by MTA-09.privateemail.com (Postfix) with ESMTPA id 687C36003F for <24896@debbugs.gnu.org>; Wed, 5 Jun 2019 02:47:21 +0000 (UTC) To: 24896@debbugs.gnu.org From: Jackson Ray Hamilton Subject: Re: bug#24896: JSX prop indentation after fat arrow Message-ID: Date: Tue, 4 Jun 2019 19:47:21 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 24896 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: -1.0 (-) A set of changes I pushed to the Emacs master branch 2 months ago should resolve this issue.  (First fixed in be86ece42c, but there were several commits after that when I broke/fixed it again.  The master branch is your best bet.) From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 06 02:59:37 2019 Received: (at 24896-done) by debbugs.gnu.org; 6 Jun 2019 06:59:37 +0000 Received: from localhost ([127.0.0.1]:48757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hYmN7-0005SG-2K for submit@debbugs.gnu.org; Thu, 06 Jun 2019 02:59:37 -0400 Received: from mta-09-4.privateemail.com ([68.65.122.29]:2922) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hYmN5-0005S1-90 for 24896-done@debbugs.gnu.org; Thu, 06 Jun 2019 02:59:35 -0400 Received: from MTA-09.privateemail.com (localhost [127.0.0.1]) by MTA-09.privateemail.com (Postfix) with ESMTP id 30A3060053 for <24896-done@debbugs.gnu.org>; Thu, 6 Jun 2019 02:59:29 -0400 (EDT) Received: from [192.168.88.227] (unknown [10.20.151.208]) by MTA-09.privateemail.com (Postfix) with ESMTPA id 0968C60051 for <24896-done@debbugs.gnu.org>; Thu, 6 Jun 2019 06:59:28 +0000 (UTC) To: 24896-done@debbugs.gnu.org From: Jackson Ray Hamilton Subject: Re: bug#24896: JSX prop indentation after fat arrow Message-ID: <4624a994-9352-160a-8cba-a505256f2da1@jacksonrayhamilton.com> Date: Wed, 5 Jun 2019 23:59:22 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: 3.1 (+++) 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: Marking this done. Content analysis details: (3.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 3.1 FAKE_REPLY_A1 No description available. X-Debbugs-Envelope-To: 24896-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.1 (++) 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: Marking this done. Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 3.1 FAKE_REPLY_A1 No description available. Marking this done. From unknown Fri Jun 20 07:09:17 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 04 Jul 2019 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator