Skip to content

Commit

Permalink
rjsx-mode supports only emacs24.4+
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen Bin committed Dec 18, 2016
1 parent 24eeda2 commit 74d7399
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
(*linux* nil)
(t nil)))

(setq *emacs24old* (or (and (= emacs-major-version 24) (= emacs-minor-version 3))
(not *emacs24*)))

;; *Message* buffer should be writable in 24.4+
(defadvice switch-to-buffer (after switch-to-buffer-after-hack activate)
(if (string= "*Messages*" (buffer-name))
Expand Down
4 changes: 2 additions & 2 deletions lisp/init-elpa.el
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ But you may use safer HTTPS instead.")
color-theme
ivy
js-doc
rjsx-mode
counsel
wgrep
robe
Expand Down Expand Up @@ -236,7 +235,8 @@ ARCHIVE is the string name of the package archive.")
(require-package 'multi-term)
(require-package 'js-doc)
(require-package 'js2-mode)
(require-package 'rjsx-mode)
(unless *emacs24old*
(require-package 'rjsx-mode))
(require-package 's)
;; js2-refactor requires js2, dash, s, multiple-cursors, yasnippet
;; I don't use multiple-cursors, but js2-refactor requires it
Expand Down
5 changes: 3 additions & 2 deletions lisp/init-javascript.el
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,10 @@ Merge RLT and EXTRA-RLT, items in RLT has *higher* priority."
((not *no-memory*)
(setq auto-mode-alist (cons '("\\.ts\\'" . js2-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.js\\(\\.erb\\)?\\'" . js2-mode) auto-mode-alist))
(add-to-list 'auto-mode-alist '("components\\/.*\\.js\\'" . rjsx-mode))
(unless *emacs24old*
(add-to-list 'auto-mode-alist '("\\.jsx\\'" . rjsx-mode))
(add-to-list 'auto-mode-alist '("components\\/.*\\.js\\'" . rjsx-mode)))
(add-to-list 'auto-mode-alist '("\\.mock.js\\'" . js-mode))
(add-to-list 'auto-mode-alist '("\\.jsx\\'" . rjsx-mode))
(add-to-list 'interpreter-mode-alist (cons "node" 'js2-mode)))
(t
(setq auto-mode-alist (cons '("\\.js\\(\\.erb\\)?\\'" . js-mode) auto-mode-alist))
Expand Down

0 comments on commit 74d7399

Please sign in to comment.