From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: stardiviner Newsgroups: gmane.emacs.help Subject: Re: Add a hook for color-theme switching Date: Sat, 2 Dec 2017 13:09:49 +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 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1512191429 13758 195.159.176.226 (2 Dec 2017 05:10:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 2 Dec 2017 05:10:29 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 To: Drew Adams , emacs-help Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Dec 02 06:10:24 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 1eL04E-000388-MO for geh-help-gnu-emacs@m.gmane.org; Sat, 02 Dec 2017 06:10:22 +0100 Original-Received: from localhost ([::1]:34375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eL04K-0003Gw-GC for geh-help-gnu-emacs@m.gmane.org; Sat, 02 Dec 2017 00:10:28 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eL03r-0003Gb-6h for help-gnu-emacs@gnu.org; Sat, 02 Dec 2017 00:10:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eL03n-0005M3-7d for help-gnu-emacs@gnu.org; Sat, 02 Dec 2017 00:09:59 -0500 Original-Received: from mail-pg0-x231.google.com ([2607:f8b0:400e:c05::231]:43930) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eL03n-0005Lp-0w for help-gnu-emacs@gnu.org; Sat, 02 Dec 2017 00:09:55 -0500 Original-Received: by mail-pg0-x231.google.com with SMTP id b18so5357624pgv.10 for ; Fri, 01 Dec 2017 21:09:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=liqWWQLU13O2mwusceBFnOeqcu2zBjDCVLKfcBMbu6A=; b=X2+US1nvxP19a4KAFoVZ1t8BWk/7FPGrBu1suoew3cTFdZhFjUUwAI9xVax9FtuGkv wV+cfjJthwKjC50eYBmpuRVtEsR2FHQhdL+oIpKnslMfPone8APt8L2eFuvoYZxCzMn4 O4R1+Rw3Sr5eB8+6WzjWTh2h+9RwrWCWZ+h2q/2WJhGBfovBWLzNNZfRulu9pgCmex6s h8m6iaEAidcy8CRuuGUCu4JCZIT/VOCGDPxKOVll7uLxs5me8Nnk40ty3WzVXrqcm5Bh 0CZ6ag9weocoLHavbQel1j5+t2m5Mvzkf8r5zb3mfA6exloIF/YDpvuQjFeXIcDa0uis KWNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=liqWWQLU13O2mwusceBFnOeqcu2zBjDCVLKfcBMbu6A=; b=Ml1rs8Jc8529TjKCIqAHsV8/MjR1YoDHAHRSgHBD9PW47+6AF90+1D9nrnXj5TXHV2 /kaqnVGhodwF2NCV1ZMWY9WdbYXBkgwqHnEmIj4FRazTERmimhMZyM78bnw4pV1rliHY yWmAQTKKI3qENnk6PIlJX/6bNnXFm+whqeZflApaeKV8WCfyvONyk/OyWOjQpfX9lXMF 4VCZtmV3fn9/1+TdnVlX9IIxYrd9uu3NSr7eMEo51HM49qqjhc/nZq+STF7B+oj7A0F+ 0fWsm2Mt4qv120z55l2Es+7TGLcOwr5An1A5Sc6ykqiRX0Jp0WSOFhoyYrjB7nszTDMt hWVg== X-Gm-Message-State: AJaThX4uiS7O9oOSufKdfYqzE2gWL0TjaJFkQDTO9ZaQ4oRpCWz15YTw /WgsBV0OoHEnjFd9i7sY9tySqxo= X-Google-Smtp-Source: AGs4zMbD98ptFK+7D5CqVCW5RhhR/Cuay3xbo47EY+poQeT6zbvER+tpOCxO3orXSDF6B4zIH49tIQ== X-Received: by 10.99.176.76 with SMTP id z12mr7923410pgo.358.1512191393871; Fri, 01 Dec 2017 21:09:53 -0800 (PST) Original-Received: from [0.0.0.0] ([119.28.89.243]) by smtp.gmail.com with ESMTPSA id b8sm13953097pff.26.2017.12.01.21.09.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Dec 2017 21:09:52 -0800 (PST) In-Reply-To: <2f961f6a-6279-445e-80de-d2eabdd43276@default> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::231 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:115164 Archived-At: 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.