summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/regexp-opt.el
diff options
context:
space:
mode:
authorJackson Ray Hamilton <jackson@jacksonrayhamilton.com>2019-04-10 22:53:34 -0700
committerJackson Ray Hamilton <jackson@jacksonrayhamilton.com>2019-04-10 22:53:34 -0700
commit382a508ed21e4f12ace9f8871818e25235e8f05e (patch)
tree700e5ef6533d11eff67e274811b11aebd5dcb88a /lisp/emacs-lisp/regexp-opt.el
parent9994bf17cf532f2e1d4310341da7180342202191 (diff)
downloademacs-382a508ed21e4f12ace9f8871818e25235e8f05e.tar.gz
emacs-382a508ed21e4f12ace9f8871818e25235e8f05e.tar.bz2
emacs-382a508ed21e4f12ace9f8871818e25235e8f05e.zip
Add extra text property to fix issue with js2-mode integration
* lisp/progmodes/js.el (js-jsx--put-syntax-table): New function for consistently ensuring smooth js2-mode integration. js2-mode sets syntax-table temporarily while parsing buffers—seemingly to recover from parsing interruptions—and then it later clears syntax-table blindly. When integrating with js-mode, this means that unterminated string quotes are re-broken in JSX (i.e., they become strings again, often stringifying large regions of the buffer which should not be strings). We try to treat quotes in JSXText as non-strings by setting syntax-table to a non-“string quote” syntax class, but that stops working if we lose the property. On the js2-mode end, by scanning for this second js-jsx-syntax-table property, we can recover the syntax-table property there. (js-jsx--text-range, js-jsx--syntax-propertize-tag): Use js-jsx--put-syntax-table for above reason. (js-jsx--text-properties): Clear the js-jsx-syntax-table property too.
Diffstat (limited to 'lisp/emacs-lisp/regexp-opt.el')
0 files changed, 0 insertions, 0 deletions