Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling 'linum-mode' for speedbar when global 'linum-mode' is active

I have linum-mode enabled globally in my Emacs configuration. Being enabled globally means it is also applied to the speedbar which is undesirable.

The only suggestion I found for this issue, was in the archived Emacs help mailing list, which suggests the following speedbar-mode-hook:

(add-hook 'speedbar-mode-hook (lambda () (linum-mode -1)))

Unfortunately adding this to my configuration doesn't have the desired effect and the speedbar still has line numbers.

Edit: the above add-hook seems to work correctly after all, at least for Emacs >= 24.3. Leaving question for reference purposes since there isn't any other relating to this matter on StackOverflow.

like image 784
Pedro Romano Avatar asked Jan 16 '14 07:01

Pedro Romano


1 Answers

You can use speedbar-before-popup-hook hook for achieving what you want:

(add-hook 'speedbar-before-popup-hook (lambda () (linum-mode -1)))

I am not sure why the generic mode hook is not working, though.

like image 124
juanleon Avatar answered Oct 25 '22 21:10

juanleon