Skip to content

Commit

Permalink
Improve rainbow-identifiers experience for Elisp and CL
Browse files Browse the repository at this point in the history
Make rainbow-identifiers not colorize special operators and macros, so they
always visually stand out. Rationale behind this change is that special
operators and macros in Lisp may be considered "syntax" elements, so it makes
sense to have them visually distinguished at all times.
  • Loading branch information
madand authored and duianto committed Jan 20, 2020
1 parent 1d2a1fa commit e1ad035
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.develop
Original file line number Diff line number Diff line change
Expand Up @@ -1499,6 +1499,8 @@ Other:
- Improvements:
- Added eval-thing-at-point functions to Common Lisp Layer
(thanks to Lukas Woell)
- Make rainbow-identifiers not colorize special operators and macros, so they
always visually stand out. (thanks to Andriy Kmit)
- New packages:
- Added =slime-asdf= to =slime-contribs= to enabled some slime commands like
=,load-system= (thanks to Daniel Schoepe)
Expand Down Expand Up @@ -1667,6 +1669,8 @@ Other:
(thanks to Codruț Constantin Gușoi, Sylvain Benner)
- Activate nameless only in GUI (thanks to Sylvain Benner)
- Added =flycheck-package= for package metadata linting (thanks to Uroš Perišić)
- Make rainbow-identifiers not colorize special operators and macros, so they
always visually stand out. (thanks to Andriy Kmit)
**** Emoji
- Added support for Emoji fonts on macOS and Linux (thanks to CodeFalling)
- Setup =emojify= cache directory (thanks to Boris Buliga)
Expand Down
4 changes: 4 additions & 0 deletions layers/+lang/common-lisp/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
helm
helm-gtags
parinfer
rainbow-identifiers
slime
(slime-company :requires company)
))
Expand Down Expand Up @@ -63,6 +64,9 @@
(defun common-lisp/post-init-parinfer ()
(add-hook 'lisp-mode-hook 'parinfer-mode))

(defun common-lisp/post-init-rainbow-identifiers ()
(add-hook 'lisp-mode-hook #'colors//rainbow-identifiers-ignore-keywords))

(defun common-lisp/pre-init-slime-company ()
(spacemacs|use-package-add-hook slime
:pre-config
Expand Down
4 changes: 4 additions & 0 deletions layers/+lang/emacs-lisp/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
nameless
overseer
parinfer
rainbow-identifiers
semantic
smartparens
srefactor
Expand Down Expand Up @@ -280,6 +281,9 @@
(defun emacs-lisp/post-init-parinfer ()
(add-hook 'emacs-lisp-mode-hook 'parinfer-mode))

(defun emacs-lisp/post-init-rainbow-identifiers ()
(add-hook 'emacs-lisp-mode-hook #'colors//rainbow-identifiers-ignore-keywords))

(defun emacs-lisp/post-init-semantic ()
(add-hook 'emacs-lisp-mode-hook 'semantic-mode)
(with-eval-after-load 'semantic
Expand Down
6 changes: 6 additions & 0 deletions layers/+themes/colors/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
(when (derived-mode-p 'prog-mode)
(rainbow-identifiers-mode)))

(defun colors//rainbow-identifiers-ignore-keywords ()
"Do not colorize stuff with ‘font-lock-keyword-face’."
(setq-local rainbow-identifiers-faces-to-override
(delq 'font-lock-keyword-face
rainbow-identifiers-faces-to-override)))

(defun colors//tweak-theme-colors (theme)
"Tweak color themes by adjusting rainbow-identifiers."
(interactive)
Expand Down

0 comments on commit e1ad035

Please sign in to comment.