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:17:17 +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 1512303493 29421 195.159.176.226 (3 Dec 2017 12:18:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 3 Dec 2017 12:18:13 +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:18:08 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 1eLTDk-0007PU-I6 for geh-help-gnu-emacs@m.gmane.org; Sun, 03 Dec 2017 13:18:08 +0100 Original-Received: from localhost ([::1]:38637 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLTDr-0004qP-Qn for geh-help-gnu-emacs@m.gmane.org; Sun, 03 Dec 2017 07:18:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLTDR-0004qK-Na for help-gnu-emacs@gnu.org; Sun, 03 Dec 2017 07:17:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eLTDQ-0000Of-JM for help-gnu-emacs@gnu.org; Sun, 03 Dec 2017 07:17:49 -0500 Original-Received: from mail-oi0-x232.google.com ([2607:f8b0:4003:c06::232]:41170) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eLTDQ-0000Nh-Cx for help-gnu-emacs@gnu.org; Sun, 03 Dec 2017 07:17:48 -0500 Original-Received: by mail-oi0-x232.google.com with SMTP id t78so9961165oie.8 for ; Sun, 03 Dec 2017 04:17:48 -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=n4xrYpJ4ixgN6CEVmIaLZnQr/hFveFZXri0W5SCZ6/I=; b=XIzXvXZzQ1G7kXM7IZc56ZSkvO+qFF3wcd81HJnSd0cditpoZ9kbjGvvYfUKkYumyb 0iugGh2oJbaa66maF/6OeCWi8D2XbroYhXX2k05bHeMB99kbjyDe1/wHP3MSTkaet+sr SjYqsPvxN/3aPeHhPKCC+cQoBL/Q0vFscqXbubcSPsVXE4q0bGQ0xCLJlo1CcA2o2UEQ /aHGDHfHgAOGov/8w16TOI5n3VINLnZByW0rDhp/+MVK4Zo0vHTHm7aN7Hk+hbOsY2iQ hTFu8VmQ/8GmE8VjJ0FQDdIJcqZT+/0R6HIliew5lUZS5VD6k8FKmLW2cjP1Wx3pynd4 QBuw== 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=n4xrYpJ4ixgN6CEVmIaLZnQr/hFveFZXri0W5SCZ6/I=; b=rO9z86DZbJd14jQ0tY3h1dlEM91RwJlCxm2YdfmTDbxTXOm3gIvfs27i+vjiKGLVHP tbCZ6f/FwpRUgoQl/c3RShpLJHF/aPVucEwA690luNJukX0pOReRl6plnN2l7CYk9mxP wOrSB3kE2Zl0RWOvIfJJrcPj9z+YMzuDh8BvjOzSxciqOj3g7n/0dpx2bPlZ/KHa3386 ybMSSdTbcH5iU78zXS120wv/2XnYqIEoU7sEIDqPMQ3T3rcHEZVA4ukQC9t5lRE/dzdG 0KpcEsvBUhGu/IE2PvkIj1n6pt5VQODSTa8pWOzmFu5qh0XD6buklbohbHJL77o0XIGD NQjQ== X-Gm-Message-State: AJaThX7udgczP14b2n83ZYNfG5TCmlsQIG/rKsLsYiC9ouRvAfGSEnxs jzFI+4TxENRBg5tSxzLTB9pmxTcevGTrG+YlSQ== X-Google-Smtp-Source: AGs4zMZ1sJoRgEmy83ocTrn9jmIeJgqkXFk2qjs0taUkTOk+pyMNbGYBuBiDpIqGT+J9AGW6c7zep+jcTtlCN0Bf1wc= X-Received: by 10.202.192.5 with SMTP id q5mr10996775oif.347.1512303467796; Sun, 03 Dec 2017 04:17:47 -0800 (PST) Original-Received: by 10.157.43.98 with HTTP; Sun, 3 Dec 2017 04:17:17 -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:c06::232 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:115185 Archived-At: You're right, `color-theme-mode-hook` does not work for my purpose. And I'm not using CustomThemes. Themes there is no existing way to do this. [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 Sun, Dec 3, 2017 at 8:12 PM, numbchild@gmail.com wrote: > 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. >> > >