[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/js2-mode d9bba5b 12/61: Update recommendations for usin
From: |
Dmitry Gutov |
Subject: |
[elpa] externals/js2-mode d9bba5b 12/61: Update recommendations for using JSX with respect to Emacs 27 |
Date: |
Sun, 20 Dec 2020 12:19:59 -0500 (EST) |
branch: externals/js2-mode
commit d9bba5b51097e4915a36f652742588128aca3211
Author: Jackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Commit: Jackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Update recommendations for using JSX with respect to Emacs 27
---
js2-mode.el | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/js2-mode.el b/js2-mode.el
index ab0d05a..6e2c30e 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -56,16 +56,13 @@
;; (add-hook 'js-mode-hook 'js2-minor-mode)
+;; If you use Emacs 27 and desire JSX support added in that release,
+;; use `js-mode' as your major mode with `js2-minor-mode' enabled.
+
;; You may also want to hook it in for shell scripts running via node.js:
;; (add-to-list 'interpreter-mode-alist '("node" . js2-mode))
-;; Support for JSX is available via the derived mode `js2-jsx-mode'. If you
-;; also want JSX support, use that mode instead:
-
-;; (add-to-list 'auto-mode-alist '("\\.jsx?\\'" . js2-jsx-mode))
-;; (add-to-list 'interpreter-mode-alist '("node" . js2-jsx-mode))
-
;; To customize how it works:
;; M-x customize-group RET js2-mode RET
@@ -11762,11 +11759,12 @@ Selecting an error will jump it to the corresponding
source-buffer error.
;; Schedule parsing for after when the mode hooks run.
(js2-mode-reset-timer)))
-;; We may eventually want js2-jsx-mode to derive from js-jsx-mode, but that'd
be
-;; a bit more complicated and it doesn't net us much yet.
;;;###autoload
(define-derived-mode js2-jsx-mode js2-mode "JSX-IDE"
- "Major mode for editing JSX code.
+ "Major mode for editing JSX code in Emacs 26 and earlier.
+
+To edit JSX code in Emacs 27, use `js-mode' as your major mode
+with `js2-minor-mode' enabled.
To customize the indentation for this mode, set the SGML offset
variables (`sgml-basic-offset' et al) locally, like so:
@@ -11774,6 +11772,15 @@ variables (`sgml-basic-offset' et al) locally, like so:
(defun set-jsx-indentation ()
(setq-local sgml-basic-offset js2-basic-offset))
(add-hook \\='js2-jsx-mode-hook #\\='set-jsx-indentation)"
+ (unless (version< emacs-version "27.0")
+ ;; Emacs 27 causes a regression in this mode since JSX indentation
+ ;; begins to rely on js-mode’s `syntax-propertize-function', which
+ ;; JS2 is not currently using.
+ ;; https://github.com/mooz/js2-mode/issues/529 should address
+ ;; this. https://github.com/mooz/js2-mode/issues/530 also has a
+ ;; piece related to the design of `js2-jsx-mode'. Until these
+ ;; issues are addressed, ward Emacs 27 users away from this mode.
+ (display-warning 'js2-mode "For JSX support, use js-mode with
js2-minor-mode"))
(set (make-local-variable 'indent-line-function) #'js2-jsx-indent-line))
(defun js2-mode-exit ()
- [elpa] externals/js2-mode 7db4871 06/61: Merge pull request #519 from lelit/issue518, (continued)
- [elpa] externals/js2-mode 7db4871 06/61: Merge pull request #519 from lelit/issue518, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 5434da3 10/61: [ci skip] Link to INSTALL.REPO, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 46aed6d 11/61: Extend explanation to disclaim key issue but provide an alternative, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode ae9fea8 07/61: Make js2-minor-mode avoid changing the syntax-table text property, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode bf7191c 08/61: Recommend js-mode + js2-minor-mode and Emacs 27 for JSX, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 2ce4985 09/61: [ci skip] Stop mentioning Emacs 22 and 23, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 1662cb8 13/61: Document changes with relation to JSX support added in Emacs 27, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 41ca3ad 14/61: Reference latest revision of the commentary, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 037bcf7 16/61: Clarify what is likely to fail, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode e785721 17/61: Reference latest revision of the commentary, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode d9bba5b 12/61: Update recommendations for using JSX with respect to Emacs 27,
Dmitry Gutov <=
- [elpa] externals/js2-mode 6cc0a8a 15/61: Merge paragraphs so the information reads better, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 14113fe 18/61: Remove date, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 8e2cdd4 19/61: Revert extra added information, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode bb73461 20/61: Revert doc changes and explain JSX options for all emacsen later, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 3a80b00 25/61: use type face for class, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 9837d78 28/61: Fix ‘huge-hex’ test for newer Emacsen., Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 515d876 27/61: Fix parsing static props without semicolons, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 61a8c91 29/61: Merge pull request #550 from phst/huge-hex, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 997d6bd 30/61: Avoid undefined behavior in indentation tests., Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 999c0e7 22/61: Merge pull request #531 from jacksonrayhamilton/jsx-documentation, Dmitry Gutov, 2020/12/20