Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable global minor mode in a specified major mode

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?

like image 820
zwb Avatar asked Sep 28 '22 12:09

zwb


1 Answers

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)))
like image 80
Tom Tromey Avatar answered Oct 05 '22 07:10

Tom Tromey