Every time I start emacs and visit my first reStructuredText file, I discover that I once again have the default colors for the section headings, which are illegible to me.

If I have the customizer open in another window while I open the first reStructuredText file, I can see the colors revert to their defaults right before my eyes.

Then, if I open my ~/.emacs file and re-execute this statement with C-x C-e, the colors right themselves:

  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(rst-level-1-face ((t (:background "blue1"))) t)
 '(rst-level-2-face ((t (:background "blue2"))) t)
 '(rst-level-3-face ((t (:background "blue3"))) t)
 '(rst-level-4-face ((t (:background "blue4"))) t)
 '(rst-level-5-face ((t (:background "navy"))) t))

How would I hunt down the thing that is causing my colors to change?

  • 3
    Sounds like some Lisp code somewhere changes the backgrounds. Did you try grepping for rst-level.*face? Did you also check the faces just after you start Emacs, before visiting a reStructuredText file? – Drew Nov 16 '15 at 22:12
  • Thank you for your useful comment. I have completely recast my question. Where would I grep for the offending Lisp code (on Linux)? – davidrmcharles Nov 17 '15 at 18:45
  • The Lisp code distributed with Emacs is in and under directory EMACS/share/emacs/VERSION/lisp/, where EMACS is the directory where you installed Emacs and VERSION` is the Emacs release number. But you might also be loading Lisp code from other libraries. Perhaps you load a library whose name contains rst? If so, try grepping there. (You can also get to the distribution's lisp/ directory by doing M-x find-library RET subr.el and then doing C-x d.) – Drew Nov 17 '15 at 19:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.