From a4b8aa0982fc3721b66735a8c90a4fe56f804f40 Mon Sep 17 00:00:00 2001 From: Bernd Haug Date: Sun, 11 Oct 2015 21:44:08 +0200 Subject: [PATCH] Improve rainbow-delimiters activation. * If rainbow-delimiters-mode-enable is available: * Check if Emacs >= 24.1, if so enable it for prog-mode * Else enable it for lisp-mode * Use the (broken) global-rainbow-delimiters-mode as before --- customizations/editing.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/customizations/editing.el b/customizations/editing.el index 61374510f..f316dd0d8 100644 --- a/customizations/editing.el +++ b/customizations/editing.el @@ -52,7 +52,12 @@ (global-set-key (kbd "C-;") 'toggle-comment-on-line) ;; yay rainbows! -(global-rainbow-delimiters-mode t) +(if (fboundp 'rainbow-delimiters-mode-enable) + (if (or (> emacs-major-version 24) + (and (eq emacs-major-version 24) (>= emacs-minor-version 1))) + (add-hook 'prog-mode-hook 'rainbow-delimiters-mode-enable) + (add-hook 'lisp-mode-hook 'rainbow-delimiters-mode-enable)) + (global-rainbow-delimiters-mode)) ;; use 2 spaces for tabs (defun die-tabs ()