Emacs: Enable minor mode in all buffers
Hi all,
Does anyone know how to enable an emacs minor mode by default for all buffers? For example, I have the minor mode highlight-80+-mode that I can toggle with M-x highlight-80+mode, however I would like this to be on by default. Any pointers to documentation/config/lisp stuff appreciated. Many thanks, Nick |
Hello,
may be you can find something useful here http://www.linuxjournal.com/node/2801/print in the section related to "Using hooks" Hope this could help you Bye David |
Quote:
Thanks again, Nick |
I am wonder why the author was satisfied with the answer that isn't an answer to the question at all… It took me for a while to find a way, so I am decided to share a real answer:
Emacs have the macro «define-global-minor-mode». It was a bit hard to me to figure out the right way of passing arguments — I all the time thought that the first arg is a string, and the second should be quoted. Until I found an example in a mailing list — then I saw: it's a macro, not a function! So, an example with one useful minor mode: Code:
(define-global-minor-mode global-highlight-symbol-mode ;;the name of the new global mode Don't forget to enable it with «M-x global-highlight-symbol-mode» (or whatever the name you used). |
Quote:
|
All times are GMT -5. The time now is 12:10 AM. |