8

I use Prelude, I want enable hs-minor-mode in all prog-modes, except web-mode. I wrote

(add-hook 'prog-mode-hook #'hs-minor-mode)          
(make-variable-buffer-local 'hs-minor-mode)        
(add-hook 'web-mode-hook (lambda () (setq hs-minor-mode nil)))      

in personal.el, but it doesn't work!

What should I do?

Drew
  • 29,895
  • 7
  • 74
  • 104
zwb
  • 739
  • 1
  • 7
  • 17
  • Duplicate of [automatically disable a global minor mode for a specific major mode](http://stackoverflow.com/questions/6837511/automatically-disable-a-global-minor-mode-for-a-specific-major-mode) – phils Oct 13 '15 at 07:32

1 Answers1

8

Normally, to disable a minor mode, it is not enough to set the variable. You must call the mode function. So try something like:

(add-hook 'web-mode-hook (lambda () (hs-minor-mode -1)))
Tom Tromey
  • 21,507
  • 2
  • 45
  • 63