From: Jackson Ray Hamilton <jackson@jacksonrayhamilton.com>
To: Dmitry Gutov <dgutov@yandex.ru>,
Felipe Ochoa <felipe.nospam.ochoa@gmail.com>,
24896@debbugs.gnu.org
Subject: bug#24896: JSX prop indentation after fat arrow
Date: Mon, 21 Nov 2016 21:48:45 -0800 [thread overview]
Message-ID: <77f1f91d-2f8c-0509-7a16-50bae68f3883@jacksonrayhamilton.com> (raw)
In-Reply-To: <6d48deda-1d14-2d50-ca86-c89f35bf37db@yandex.ru>
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?
next prev parent reply other threads:[~2016-11-22 5:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-07 9:56 bug#24896: JSX prop indentation after fat arrow Felipe Ochoa
2016-11-19 22:47 ` Dmitry Gutov
2016-11-22 5:48 ` Jackson Ray Hamilton [this message]
[not found] ` <CAHp7JggpF+APETs=BaX-yJMrcX+u55NoXanj_krbfdD-78WRTw@mail.gmail.com>
2016-12-08 11:12 ` Felipe Ochoa
2016-12-09 0:18 ` Dmitry Gutov
2017-01-06 17:44 ` Felipe Ochoa
2017-01-15 2:04 ` Dmitry Gutov
2017-01-23 9:26 ` Felipe Ochoa
2017-01-23 17:07 ` Jackson Ray Hamilton
2017-01-25 1:59 ` Dmitry Gutov
2019-06-05 2:47 ` Jackson Ray Hamilton
2019-06-06 6:59 ` Jackson Ray Hamilton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=77f1f91d-2f8c-0509-7a16-50bae68f3883@jacksonrayhamilton.com \
--to=jackson@jacksonrayhamilton.com \
--cc=24896@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
--cc=felipe.nospam.ochoa@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).