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.
This commit is contained in:
Curtis Mackie 2016-06-01 12:04:17 -05:00 committed by syl20bnr
parent a4db13e3a6
commit edd7a501c8
3 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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."