0

I have css-mode and javascript-mode and if I open css file the indent-region-function is set to css-indent-region which break javascript-mode indent region, how can I fix that? the workaround is to execute:

(setq indent-region-function nil)

after I switch to css-mode, is there a way to fix this without this hack?

Calling this:

(defun css-indent-mode-fix ()
  (setq indent-region-function nil))

(add-hook 'css-mode-hook 'css-indent-mode-fix)

Disable indent region in css mode.

  • I'm unsure what you're trying to do, could you provide a more concrete example? – Jordon Biondo Jan 7 '16 at 14:09
  • @JordonBiondo If I open css file and switch to javascript file the indent region don't work, I still have css-indent-region in indent-region-function variable. – jcubic Jan 7 '16 at 16:14
  • 1
    Does this happen with emacs -Q? The function css-indent-region does not exist for me, it may be coming from somewhere else. What version of emacs are you using? – Jordon Biondo Jan 7 '16 at 16:29
  • @JordonBiondo It work fine with emacs -Q, the problem was my css-mode version 0.3 that was created by Alex Shinn, instead of build in emacs css-mode. – jcubic Jan 8 '16 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.