I am using Protesilaos Stavrou's excellent modus-themes, and I am loving it.
Now I'd like to add a gray background to code blocks in org-files, and I can make it work with the code below, but whenever I re-open a buffer, I need to re-evaluate the code below.
How can I make the change permanent, without re-evaluationg my `init.el` file constantly?
;;;; add colors to code and quote blocks
(setq org-fontify-quote-and-verse-blocks t)
;; https://stackoverflow.com/questions/44811679/orgmode-change-code-block-background-color
;; The example below will darken the code block by 4 percent (notice the number 4 at the last parameter) relative to the background color of your emacs theme. However, if you change your theme during editing the color of the code block will stay the same.
(require 'color)
(set-face-attribute 'org-block nil :background
(color-darken-name (face-attribute 'default :background) 4)) ;; 4% darker
## Edit
Apparently the theme comes with lots of customization options, see here:
https://elpa.gnu.org/packages/modus-themes.html
So `M-x customize-variable RET modus-themes-org-blocks RET` give me the option to change the background of org-blocks.