One issue with themes in Emacs is that they tend not to set the org-hide face properly so that leading stars in headings become visible. I have written a function to set the org-hide foreground to the default background when a theme is enabled, but it is not exactly working. It works if I invoke it manually but not when invoked in a hook called when a new theme is enabled. Here is what I have:
(defun ded:set-org-hide ()
"Make sure that both the background and foreground colors of the org-hide face
matches the background of the default face."
(interactive)
(message "ded:set-org-hide")
(set-face-attribute 'org-hide nil
:foreground
(face-attribute 'default :background nil t)))
(add-hook 'after-enable-theme-hook #'ded:set-org-hide)
I know it is getting invoked because I see the message, but it does not set the org-hide face for some reason.
Any ideas?