From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "numbchild@gmail.com" Newsgroups: gmane.emacs.help Subject: Re: Add a hook for color-theme switching Date: Sun, 3 Dec 2017 20:12:56 +0800 Message-ID: References: <2f961f6a-6279-445e-80de-d2eabdd43276@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1512303237 12182 195.159.176.226 (3 Dec 2017 12:13:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 3 Dec 2017 12:13:57 +0000 (UTC) Cc: emacs-help To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 03 13:13:53 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eLT9a-0002iK-Fe for geh-help-gnu-emacs@m.gmane.org; Sun, 03 Dec 2017 13:13:50 +0100 Original-Received: from localhost ([::1]:38625 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLT9g-0003Xe-8q for geh-help-gnu-emacs@m.gmane.org; Sun, 03 Dec 2017 07:13:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLT9F-0003Ob-TB for help-gnu-emacs@gnu.org; Sun, 03 Dec 2017 07:13:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eLT9E-0004WA-IQ for help-gnu-emacs@gnu.org; Sun, 03 Dec 2017 07:13:29 -0500 Original-Received: from mail-ot0-x233.google.com ([2607:f8b0:4003:c0f::233]:40749) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eLT9E-0004VW-D3 for help-gnu-emacs@gnu.org; Sun, 03 Dec 2017 07:13:28 -0500 Original-Received: by mail-ot0-x233.google.com with SMTP id e74so12552737ote.7 for ; Sun, 03 Dec 2017 04:13:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=w6LNfONbShbH9UKf5pcdLOYtL9fed9XBg3eosYmlNqw=; b=FOzs8GkU2TZBO8ST46rkmHdRyGyrWAWxrWsyKYBEDgX9HkbMyp+VhOQ477HEMthuTo WsDQgpbxrOaEsDCXZjlmXXgiedW6jvvNjoGWT4Jx+XKZ6QWA3lVK8vGR1qgxG9QMIIOZ C63CxVoV9iZ6EPBGbrgOwCSVkax8F4n54pjNcYLLLP/QdABoyT3fpAeguDG0Izm9896E nFwwDHiEwTw78m/xmktx0Ns2/cyAqVuPl3m6CsKogu7XwE4bVivLRuw+Hariecgbe9fB dDjPDYy0L9wqrd6zWpJNYK4RhjkeFjsQFS1tDxQfEF5aOPVz9/5Z6P8oq5zxHy0nnmp/ G7Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=w6LNfONbShbH9UKf5pcdLOYtL9fed9XBg3eosYmlNqw=; b=UwmgLc/W3/S9H84YPAb5LBNaQ+ZN0YCf2z3H+8g2OZjY0moufbvYk2iAkJkGwKkyxn bXHmY0h1hnagptehzmknw2FsE7NJ9Nhhldb2vyxUWg13p5wAEs1FlTajTWzHnbfvbPRt 7oDvPWhRA0QeVoi8wxF5uz4Iny23WOP0A2UolnKdCz4+8RZg7W2BBN7JzYV4VgmNYFEg 5F3rlANpc56qDqP6NlEtROSy5pVQBI+wn3b/PtGBvQ+PfvYsxhQYEtZFYwHxWcbFogXd qO1LP4muLpcJmNBsGbEBl2eD5uhiYTMPFgfLX3beJOOlliUINNc8quzYpLFDqDcPkaPz Mk1g== X-Gm-Message-State: AJaThX7G8Bpm7pANd3SzdJViU2LM1MDGidqPZPJnWe5z/svN5+MtsqYy sPJWUFtdL9dlVqvvF6gFxZbGefwdv3OBuE7wag== X-Google-Smtp-Source: AGs4zMbG3+7j+4AXQ/2FBkEPAxk06ugdCs6SKW6bGyW+bwetWReVZMm6GH6vOknyTLFlDN4+ik0MLj2isEV54SsH7IQ= X-Received: by 10.157.12.65 with SMTP id 59mr12329984otr.183.1512303207430; Sun, 03 Dec 2017 04:13:27 -0800 (PST) Original-Received: by 10.157.43.98 with HTTP; Sun, 3 Dec 2017 04:12:56 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c0f::233 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:115184 Archived-At: Seems I'm using `color themes`. I only have `color-theme-mode-hook`, don't have `custom-new-theme-mode-hook`, `custom-theme-choose-mode-hook`. Thanks for your explaination. [stardiviner] GPG key ID: 47C32433 IRC(freeenode): stardiviner Twitter: @numbchild Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 Blog: http://stardiviner.github.io/ On Sat, Dec 2, 2017 at 11:38 PM, Drew Adams wrote: > > Here is an example showing what I want: > > (add-hook 'color-theme-load-hook > > (lambda () > > (set-face-attribute 'hl-sexp-face nil :background ...) > > Then the custom faces can be changed automatically according the > > color-theme switching. > > If you really are using color themes (`color-theme.el') > then you have `color-theme-mode-hook', but that likely > won't help here. There is no `color-theme-load-hook', > AFAIK. > > On the other hand, if you are using custom themes then > there are `custom-new-theme-mode-hook' and > `custom-theme-choose-mode-hook'. > > You have not yet made clear which kind of themes you are > using (though you keep saying "color theme"): custom > themes or color themes. >