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:
parent
a4db13e3a6
commit
edd7a501c8
|
@ -28,12 +28,12 @@ file.
|
||||||
|
|
||||||
** Enable rainbow-identifiers
|
** Enable rainbow-identifiers
|
||||||
|
|
||||||
To enable the package =rainbow-identifiers= set the variable
|
To enable =rainbow-identifiers-mode= by default, set the variable
|
||||||
=colors-enable-rainbow-identifiers= to =t=:
|
=colors-enable-rainbow-identifiers-by-default= to =t=:
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq-default dotspacemacs-configuration-layers '(
|
(setq-default dotspacemacs-configuration-layers '(
|
||||||
(colors :variables colors-enable-rainbow-identifiers t)))
|
(colors :variables colors-enable-rainbow-identifiers-by-default t)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Saturation and lightness of identifiers can be set per theme by adding
|
Saturation and lightness of identifiers can be set per theme by adding
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
;; Variables
|
;; Variables
|
||||||
|
|
||||||
(defvar colors-enable-rainbow-identifiers nil
|
(defvar colors-enable-rainbow-identifiers-by-default nil
|
||||||
"If non nil the `rainbow-identifers' package is enabled.")
|
"If non nil the `rainbow-identifers' package is enabled.")
|
||||||
|
|
||||||
(defvar colors-enable-nyan-cat-progress-bar nil
|
(defvar colors-enable-nyan-cat-progress-bar nil
|
||||||
|
|
|
@ -43,7 +43,6 @@
|
||||||
|
|
||||||
(defun colors/init-rainbow-identifiers ()
|
(defun colors/init-rainbow-identifiers ()
|
||||||
(use-package rainbow-identifiers
|
(use-package rainbow-identifiers
|
||||||
:if colors-enable-rainbow-identifiers
|
|
||||||
:commands rainbow-identifiers-mode
|
:commands rainbow-identifiers-mode
|
||||||
:init
|
:init
|
||||||
(progn
|
(progn
|
||||||
|
@ -62,7 +61,8 @@
|
||||||
:documentation "Colorize identifiers globally."
|
:documentation "Colorize identifiers globally."
|
||||||
:evil-leader "tCi")
|
: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)
|
(defun colors//tweak-theme-colors (theme)
|
||||||
"Tweak color themes by adjusting rainbow-identifiers."
|
"Tweak color themes by adjusting rainbow-identifiers."
|
||||||
|
|
Loading…
Reference in a new issue