Make "lst:setup-rainbow-mode" safer

This commit is contained in:
Gerard Vermeulen 2024-06-14 21:04:11 +02:00
parent 5efb7c71e3
commit 8aa7843b42

View File

@ -5842,12 +5842,11 @@ and names in buffers for debugging.
#+name: lst:setup-rainbow-mode
#+begin_src emacs-lisp -n :results silent
(when (ensure-package-installation 'rainbow-mode)
;; GAV: Do not add `rainbow-mode' to any programming language hook,
;; since that interferes at least with Org export to LaTeX.
(setopt rainbow-x-colors-major-mode-list
(list 'c++-mode 'c-mode 'emacs-lisp-mode 'inferior-emacs-lisp-mode
'lisp-interaction-mode 'org-mode 'python-mode))
;; GAV: How to disable `rainbow-mode' on `emacs-lisp-mode-hook'?
(dolist (symbol '(python-mode-hook))
(add-hook symbol #'rainbow-mode)))
'lisp-interaction-mode 'org-mode 'python-mode)))
#+end_src
** [[https://karthinks.com/software/batteries-included-with-emacs/][Flash the line around point for visual feedback]]