jlr / rainbow-delimiters

Emacs rainbow delimiters mode
http://www.emacswiki.org/emacs/RainbowDelimiters
112 stars 12 forks source link

Make (global-rainbow-delimiters-mode 1) work as intended. #2

Closed immerrr closed 12 years ago

immerrr commented 12 years ago

Hi!

I like your recent addition of global-rainbow-delimiters-mode. Though it doesn't work well when turning mode on explicitly via (global-rainbow-delimiters-mode 1). This is due to the following issue with define-globalized-minor-mode. The doc states:

(define-globalized-minor-mode GLOBAL-MODE MODE TURN-ON &rest KEYS)

TURN-ON is a function that will be called with no args in every buffer
and that should try to turn MODE on if applicable for that buffer.

Your code passes rainbow-delimiter-mode as TURN-ON, but (rainbow-delimiter-mode) toggles the mode instead of turning it on.

I've wrote a little hack to fix this. Feel free to update the actual code in whatever way you like.

jlr commented 12 years ago

Glad you caught this. Just merged in your patch. Thanks for pointing it out!