emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master df3f97f 030/110: Add js2-jsx-mode


From: Dmitry Gutov
Subject: [elpa] master df3f97f 030/110: Add js2-jsx-mode
Date: Thu, 23 Jun 2016 01:12:54 +0000 (UTC)

branch: master
commit df3f97ff3e9b05ab4bcda028a792a857390b116e
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>

    Add js2-jsx-mode
---
 js2-mode.el |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/js2-mode.el b/js2-mode.el
index 643e921..dd97aba 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -11373,6 +11373,17 @@ Selecting an error will jump it to the corresponding 
source-buffer error.
 
   (js2-reparse))
 
+;; 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.
+Like `js-jsx-mode', which see.
+Indentation support requires Emacs 25+ (or the latest js.el)."
+  ;; Feature-detect JSX indentation support (in js-mode from Emacs 25+).
+  (if (fboundp 'js-jsx-indent-line)
+      (set (make-local-variable 'indent-line-function) #'js-jsx-indent-line)))
+
 (defun js2-mode-exit ()
   "Exit `js2-mode' and clean up."
   (interactive)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]