all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Add a hook for color-theme switching
@ 2017-12-01 10:45 stardiviner
  2017-12-01 16:14 ` Drew Adams
  0 siblings, 1 reply; 6+ messages in thread
From: stardiviner @ 2017-12-01 10:45 UTC (permalink / raw)
  To: emacs-help

Here is a case:

I use package =hl-sexp= to highlight sexp in Lisp code:

#+begin_src emacs-lisp
(use-package hl-sexp
  :ensure t
  :config
  (set-face-attribute 'hl-sexp-face nil
                      :background (cl-case (alist-get 'background-mode
(frame-parameters))
                                    ('light
                                     (color-darken-name (face-background
'default) 7))
                                    ('dark
                                     (color-lighten-name
(face-background 'default) 4)))
                      )
  )
#+end_src

When I start Emacs, the face ~hl-sexp-face~ is been set by the Emacs
initialized
color-theme. Then I use package =circadian= to auto switch color-theme
or manually
switch color-theme with command =disable-theme= and =load-theme=. But
this face
~hl-sexp-face~ is defined already, usually not good for another switched
color-theme.

So I hope there is a hook for switching color-theme like
~color-theme-switch-hook~ etc.

This is useful for package =circadian=.




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-12-03 12:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-01 10:45 Add a hook for color-theme switching stardiviner
2017-12-01 16:14 ` Drew Adams
2017-12-02  5:09   ` stardiviner
2017-12-02 15:38     ` Drew Adams
2017-12-03 12:12       ` numbchild
2017-12-03 12:17         ` numbchild

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.