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:
(define-global-minor-mode global-highlight-symbol-mode ;;the name of the new global mode
highlight-symbol-mode ;;the name of the minor mode you want to turn on
(lambda () (highlight-symbol-mode t) ;;the function to turn on the mode
I didn't quite understood, though, what is the need of the second argument, since the mode is enabled in the last one.
Don't forget to enable it with «M-x global-highlight-symbol-mode» (or whatever the name you used).