New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(set-web-mode-content-type "jsx") in web-mode hook doesn't do anything #452

Closed
neverov opened this Issue Mar 13, 2015 · 5 comments

Comments

Projects
None yet
4 participants
@neverov

neverov commented Mar 13, 2015

I'm trying to enable jsx support by default for all js files.
I took this example with jsx embedded into .js files and wrote the following hook:

(add-hook 'web-mode-hook
          (lambda ()
            (web-mode-set-content-type "jsx")
            (message "now set to: %s" web-mode-content-type)))

When I open a file, web mode is enabled, but jsx is not highlighted.

@neverov

This comment has been minimized.

Show comment
Hide comment
@neverov

neverov Mar 13, 2015

My bad. Restarted emacs and now everything is working as it supposed to.

neverov commented Mar 13, 2015

My bad. Restarted emacs and now everything is working as it supposed to.

@neverov neverov closed this Mar 13, 2015

@fxbois

This comment has been minimized.

Show comment
Hide comment
@fxbois

fxbois Mar 13, 2015

Owner

@neverov have just restarted or "updated and restarted" ?

Owner

fxbois commented Mar 13, 2015

@neverov have just restarted or "updated and restarted" ?

@neverov

This comment has been minimized.

Show comment
Hide comment
@neverov

neverov Mar 13, 2015

Well, the first time I wrote this piece, executed it in place (in init.el) and reopened buffers (no effect), then just restarted emacs and it worked; I don't know emacs internals well enough to determine if there is an actual problem or it's just my setup or something else.

neverov commented Mar 13, 2015

Well, the first time I wrote this piece, executed it in place (in init.el) and reopened buffers (no effect), then just restarted emacs and it worked; I don't know emacs internals well enough to determine if there is an actual problem or it's just my setup or something else.

@mrcoles

This comment has been minimized.

Show comment
Hide comment
@mrcoles

mrcoles Jan 24, 2018

FWIW, if anyone else is not seeing the change, I had to remove an old .elc file before the change would be read.

mrcoles commented Jan 24, 2018

FWIW, if anyone else is not seeing the change, I had to remove an old .elc file before the change would be read.

@amirouche

This comment has been minimized.

Show comment
Hide comment
@amirouche

amirouche Jan 24, 2018

It would be nice that this hook was conditionnal somehow based on current extension. Right now, I use web-mode for both css and js. And css files try to use jsx web-mode :/

amirouche commented Jan 24, 2018

It would be nice that this hook was conditionnal somehow based on current extension. Right now, I use web-mode for both css and js. And css files try to use jsx web-mode :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment