From: stardiviner <numbchild@gmail.com>
To: Drew Adams <drew.adams@oracle.com>, emacs-help <help-gnu-emacs@gnu.org>
Subject: Re: Add a hook for color-theme switching
Date: Sat, 2 Dec 2017 13:09:49 +0800 [thread overview]
Message-ID: <d4747961-50b0-f844-f9b6-f2d4acb31ce3@gmail.com> (raw)
In-Reply-To: <2f961f6a-6279-445e-80de-d2eabdd43276@default>
On 12/02/2017 12:14 AM, Drew Adams wrote:
> I don't understand the problem. Are you saying that when
> you switch to another theme (presumably a custom theme)
> the appearance of face `hl-sexp-face' changes?
>
>> So I hope there is a hook for switching color-theme like
>> `color-theme-switch-hook' etc.
> Do you mean that after you switch to another theme you
> want to invoke some code? What code would you invoke?
> Is the idea just to make face `hl-sexp-face' have or
> keep the appearance you want?
Here is an example showing what I want:
#+begin_src emacs-lisp
(add-hook 'color-theme-load-hook
(lambda ()
(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
Then the custom faces can be changed automatically according the
color-theme switching.
next prev parent reply other threads:[~2017-12-02 5:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d4747961-50b0-f844-f9b6-f2d4acb31ce3@gmail.com \
--to=numbchild@gmail.com \
--cc=drew.adams@oracle.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.
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.