From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jackson Ray Hamilton Newsgroups: gmane.emacs.bugs Subject: bug#24896: JSX prop indentation after fat arrow Date: Mon, 21 Nov 2016 21:48:45 -0800 Message-ID: <77f1f91d-2f8c-0509-7a16-50bae68f3883@jacksonrayhamilton.com> References: <6d48deda-1d14-2d50-ca86-c89f35bf37db@yandex.ru> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1479793877 31182 195.159.176.226 (22 Nov 2016 05:51:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 22 Nov 2016 05:51:17 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 To: Dmitry Gutov , Felipe Ochoa , 24896@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 22 06:51:13 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c93z7-0007L7-0R for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Nov 2016 06:51:13 +0100 Original-Received: from localhost ([::1]:53371 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c93zA-0005YU-L0 for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Nov 2016 00:51:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c93z0-0005YM-52 for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2016 00:51:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c93yx-0002P7-1m for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2016 00:51:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50535) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c93yw-0002Ov-SB for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2016 00:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c93yw-0002LS-H2 for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2016 00:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jackson Ray Hamilton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Nov 2016 05:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24896 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24896-submit@debbugs.gnu.org id=B24896.14797938068938 (code B ref 24896); Tue, 22 Nov 2016 05:51:02 +0000 Original-Received: (at 24896) by debbugs.gnu.org; 22 Nov 2016 05:50:06 +0000 Original-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 Original-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 Original-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) Original-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) Original-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) Original-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) X-Enigmail-Draft-Status: N1110 In-Reply-To: <6d48deda-1d14-2d50-ca86-c89f35bf37db@yandex.ru> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:125975 Archived-At: 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?