Skip to content

Instantly share code, notes, and snippets.

@L42y
Created March 17, 2015 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save L42y/d515b3173f8c0ef60fe1 to your computer and use it in GitHub Desktop.
Save L42y/d515b3173f8c0ef60fe1 to your computer and use it in GitHub Desktop.
(defcustom pm-host/js2
(pm-bchunkmode "JS2"
:mode 'js2-mode)
"JS2 host innermode"
:group 'hostmodes
:type 'object)
(defcustom pm-inner/web
(pm-hbtchunkmode "JSX"
:mode 'web-mode
:head-reg "\\((\\)[[:space:]\n]*<"
:tail-reg ">[[:space:]\n]*\\()\\)")
"JSX innermode for web-mode"
:group 'innermodes
:type 'object)
(defcustom pm-poly/js2+web
(pm-polymode-one "JS2"
:hostmode 'pm-host/js2
:innermode 'pm-inner/web)
"JS2 polymode"
:group 'polymodes
:type 'object)
(define-polymode js2-web-mode pm-poly/js2+web)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment