From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#24896: JSX prop indentation after fat arrow Date: Sun, 20 Nov 2016 00:47:20 +0200 Message-ID: <6d48deda-1d14-2d50-ca86-c89f35bf37db@yandex.ru> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1479595692 1593 195.159.176.226 (19 Nov 2016 22:48:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 19 Nov 2016 22:48:12 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0 To: Felipe Ochoa , 24896@debbugs.gnu.org, Jackson Hamilton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 19 23:48:08 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 1c8EQa-0007tA-1Z for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Nov 2016 23:48:08 +0100 Original-Received: from localhost ([::1]:43013 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8EQd-0008S5-Ix for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Nov 2016 17:48:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8EQX-0008Rv-J6 for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2016 17:48:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c8EQU-0008P6-HF for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2016 17:48:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48212) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c8EQU-0008On-EA for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2016 17:48:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c8EQU-0000By-17 for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2016 17:48:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Nov 2016 22:48:01 +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.1479595650689 (code B ref 24896); Sat, 19 Nov 2016 22:48:01 +0000 Original-Received: (at 24896) by debbugs.gnu.org; 19 Nov 2016 22:47:30 +0000 Original-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 Original-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 Original-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) Original-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) In-Reply-To: Content-Language: en-US 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:125886 Archived-At: 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?