From edd7a501c8950d9defe36451964790780b2c9d66 Mon Sep 17 00:00:00 2001 From: Curtis Mackie Date: Wed, 1 Jun 2016 12:04:17 -0500 Subject: [PATCH] Allow user to enable rainbow-identifiers-mode without making it default Per syl20bnr's comment on PR 6192, the package should always be installed with the colors layer, but only hooked into prog-mode when the variable is active. Renamed the variable colors-enable-rainbow-identifiers-by-default to clarify this, and modified the documentation. --- layers/+themes/colors/README.org | 6 +++--- layers/+themes/colors/config.el | 2 +- layers/+themes/colors/packages.el | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/layers/+themes/colors/README.org b/layers/+themes/colors/README.org index c92a47286..8a66e8e34 100644 --- a/layers/+themes/colors/README.org +++ b/layers/+themes/colors/README.org @@ -28,12 +28,12 @@ file. ** Enable rainbow-identifiers -To enable the package =rainbow-identifiers= set the variable -=colors-enable-rainbow-identifiers= to =t=: +To enable =rainbow-identifiers-mode= by default, set the variable +=colors-enable-rainbow-identifiers-by-default= to =t=: #+BEGIN_SRC emacs-lisp (setq-default dotspacemacs-configuration-layers '( - (colors :variables colors-enable-rainbow-identifiers t))) + (colors :variables colors-enable-rainbow-identifiers-by-default t))) #+END_SRC Saturation and lightness of identifiers can be set per theme by adding diff --git a/layers/+themes/colors/config.el b/layers/+themes/colors/config.el index fc221dae4..0af844870 100644 --- a/layers/+themes/colors/config.el +++ b/layers/+themes/colors/config.el @@ -11,7 +11,7 @@ ;; Variables -(defvar colors-enable-rainbow-identifiers nil +(defvar colors-enable-rainbow-identifiers-by-default nil "If non nil the `rainbow-identifers' package is enabled.") (defvar colors-enable-nyan-cat-progress-bar nil diff --git a/layers/+themes/colors/packages.el b/layers/+themes/colors/packages.el index bd9b321fc..ed5eac469 100644 --- a/layers/+themes/colors/packages.el +++ b/layers/+themes/colors/packages.el @@ -43,7 +43,6 @@ (defun colors/init-rainbow-identifiers () (use-package rainbow-identifiers - :if colors-enable-rainbow-identifiers :commands rainbow-identifiers-mode :init (progn @@ -62,7 +61,8 @@ :documentation "Colorize identifiers globally." :evil-leader "tCi") - (add-hook 'prog-mode-hook 'rainbow-identifiers-mode) + (when colors-enable-rainbow-identifiers-by-default + (add-hook 'prog-mode-hook 'rainbow-identifiers-mode)) (defun colors//tweak-theme-colors (theme) "Tweak color themes by adjusting rainbow-identifiers."