Facilita inverting the default face and enable rainbow-mode

This commit is contained in:
Gerard Vermeulen 2021-12-13 12:41:06 +01:00
parent 432b7e7950
commit b7030e1b9b

View File

@ -1276,10 +1276,36 @@ the next source code block shows.
(set-face-attribute 'default nil :height height)))
#+end_src
This setup prefers the ~leuven~ and ~leuven-dark~ themes from [[https://melpa.org/#/][MELPA]], because the
very popular ~modus-operandi~ and ~modus-vivendi~ themes feel quirky: for
instance those themes fail to display ~hl-line-mode~ properly with Emacs-27.2 on
Darwin.
Allow swapping fhe foreground and background colors of the default face on all
frames.
#+begin_src emacs-lisp
(defun my-invert-default-face ()
"Invert the default face."
(interactive)
(invert-face 'default))
#+end_src
Enable =rainbow-mode= to colorize color names in buffers for debugging.
#+begin_src emacs-lisp
(when (fboundp 'rainbow-mode)
(custom-set-variables
'(rainbow-x-colors-major-mode-list
'(c++-mode
c-mode
emacs-lisp-mode
inferior-emacs-lisp-mode
java-mode
lisp-interaction-mode
org-mode
python-mode)))
(rainbow-mode +1))
#+end_src
This setup prefers the ~leuven~ and ~leuven-dark~ themes because the
~modus-operandi~ and ~modus-vivendi~ themes feel quirky: for instance those
themes fail to display ~hl-line-mode~ properly with Emacs-27.2 on Darwin.
[[https://emacs.stackexchange.com/questions/17431/how-do-i-change-portions-of-a-custom-theme][How to change custom theme faces]]