From: stardiviner <numbchild@gmail.com>
To: emacs-help <help-gnu-emacs@gnu.org>
Subject: Add a hook for color-theme switching
Date: Fri, 1 Dec 2017 18:45:53 +0800 [thread overview]
Message-ID: <f0b1df96-01df-340a-1e41-95bc1663ee43@gmail.com> (raw)
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=.
next reply other threads:[~2017-12-01 10:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-01 10:45 stardiviner [this message]
2017-12-01 16:14 ` Add a hook for color-theme switching 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f0b1df96-01df-340a-1e41-95bc1663ee43@gmail.com \
--to=numbchild@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).