diff options
author | Jackson Ray Hamilton <jackson@jacksonrayhamilton.com> | 2019-03-23 20:14:29 -0700 |
---|---|---|
committer | Jackson Ray Hamilton <jackson@jacksonrayhamilton.com> | 2019-04-08 22:48:22 -0700 |
commit | bf37078df2cbea3a44a641ddbe40f11339c135a2 (patch) | |
tree | cff66452d2d9ca2fbe4d676462fe76c66a311819 /test/manual/indent/js-jsx.js | |
parent | 339be7c00790fb407cc8449fa8f59baa792cbe69 (diff) | |
download | emacs-bf37078df2cbea3a44a641ddbe40f11339c135a2.tar.gz emacs-bf37078df2cbea3a44a641ddbe40f11339c135a2.tar.bz2 emacs-bf37078df2cbea3a44a641ddbe40f11339c135a2.zip |
Automatically detect JSX in JavaScript files
* lisp/files.el (auto-mode-alist): Simply enable
javascript-mode (js-mode) when opening “.jsx” files, since the “.jsx”
file extension will be used as an indicator of JSX syntax by js-mode,
and more code is likely to work in js-mode than js-jsx-mode, and we
probably want to guide users to use js-mode (with js-jsx-syntax)
instead. Code that used to work exclusively in js-jsx-mode (if anyone
ever wrote any) ought to be updated to work in js-mode too when
js-jsx-syntax is set to t.
* lisp/progmodes/js.el (js-jsx-detect-syntax, js-jsx-regexps)
(js-jsx--detect-and-enable, js-jsx--detect-after-change): New
variables and functions for detecting and enabling JSX.
(js-jsx-syntax): Update docstring with respect to the widened scope of
the effects and use of this variable.
(js-syntactic-mode-name, js--update-mode-name)
(js--idly-update-mode-name, js-jsx-enable): New variable and functions
for indicating when JSX is enabled.
(js-mode): Detect and enable JSX. Print all enabled syntaxes after
the mode name whenever Emacs goes idle; this ensures lately-enabled
syntaxes are evident.
(js-jsx-mode): Update mode name for consistency with the state in
which JSX is enabled in js-mode. Update docstring to suggest
alternative means of using JSX without this mode. Going forward, it
may be best to gently guide users away from js-jsx-mode, since a “one
mode per syntax extension” model would not scale well if more syntax
extensions were to be simultaneously supported (e.g. Facebook’s
“Flow”).
Diffstat (limited to 'test/manual/indent/js-jsx.js')
0 files changed, 0 insertions, 0 deletions