From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alex Kost Newsgroups: gmane.emacs.help Subject: Re: "clean" starting point for custom-theme-set-faces Date: Wed, 17 Sep 2014 15:41:44 +0400 Message-ID: <871trafp8n.fsf@gmail.com> References: <287e4dab-9ee0-4840-bb8f-0fc1b18a5501@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1410954152 16997 80.91.229.3 (17 Sep 2014 11:42:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Sep 2014 11:42:32 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Sam Halliday Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 17 13:42:27 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XUDcr-0002n0-F4 for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Sep 2014 13:42:21 +0200 Original-Received: from localhost ([::1]:44282 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUDcr-0000nK-2Q for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Sep 2014 07:42:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36375) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUDcT-0000g6-6Y for help-gnu-emacs@gnu.org; Wed, 17 Sep 2014 07:42:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUDcN-0003Yn-Ic for help-gnu-emacs@gnu.org; Wed, 17 Sep 2014 07:41:57 -0400 Original-Received: from mail-lb0-x22d.google.com ([2a00:1450:4010:c04::22d]:37154) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUDcN-0003Y7-Bz for help-gnu-emacs@gnu.org; Wed, 17 Sep 2014 07:41:51 -0400 Original-Received: by mail-lb0-f173.google.com with SMTP id w7so1622173lbi.32 for ; Wed, 17 Sep 2014 04:41:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=+iTqXhve+CJ+r4H4Ow14tyzYE+YGQ7Z/6jNdpQlauxg=; b=oiBieNIaJTm4xWY8Y2sPY3DdFWJHc4iwpygjgzRDMseTBnuRPyb3R9wAKUs65+sEM5 MD8bBq+1x/y6aNDF5uOdfQdut2FTc4uPOb+/Jo+bMSqDHmZHRqQO3pERNDg9zNCRgC3x ePAxlQSMvJUh61V3xfai/YjbsfbhGcAhy0FaEvIQbEq9UBhaMRCPzYqAJX8fgxFdFssW SzEnmXaZ0h1vng2vvHo9ATOlRah/2Pqb7mYwjiL0+gtz1syohfYJyQJKQPJusYk2Hzr2 sMPDNZToxPKJhBXVroyeVJdU4/ytrUqENOmrPIjPODfLKDXltXOSPsJbEBQjU6l+xJGQ hEMg== X-Received: by 10.152.234.76 with SMTP id uc12mr44125779lac.50.1410954106695; Wed, 17 Sep 2014 04:41:46 -0700 (PDT) Original-Received: from leviafan (128-70-192-205.broadband.corbina.ru. [128.70.192.205]) by mx.google.com with ESMTPSA id y5sm5853230laa.20.2014.09.17.04.41.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Sep 2014 04:41:46 -0700 (PDT) In-Reply-To: <287e4dab-9ee0-4840-bb8f-0fc1b18a5501@googlegroups.com> (Sam Halliday's message of "Wed, 17 Sep 2014 03:00:54 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::22d X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:99976 Archived-At: Sam Halliday (2014-09-17 14:00 +0400) wrote: > Hi all, > > I'm creating a custom colour theme for emacs inspired by IntelliJ's Darcula. Work in progress here: > > https://github.com/fommil/unix/blob/master/.emacs.d/lisp/Darkula-theme.el > > > But there are a couple of things that confuse me about emacs faces, even after reading the documentation and I'd appreciate some guidance: > > 1. When a theme is loaded, what are the default "inherit" values for all the faces that I'm defining? Is there an implicit "inherit" based on what that face was before the theme was loaded? > I've found that I need to override a lot of things with e.g. ":underline nil" when actually I want to be defining my faces from a clean slate, inheriting from "default" without having to explicitly write that. IIUC you are faced with the old behavior of applying faces that will be "fixed" in Emacs 24.4. I wrote something about that here: . > 2. How do I re-use attributes inside custom-theme-set-faces? I can't put the list of faces inside a (let ) because custom-theme-set-faces is expecting one parameter per face. Ideally I'd like to define a bunch of things in some form of data structure so that I don't have to repeat the values, and also so that I can parametrise the theme. (e.g. I could have a function that returns my theme with a permutation on font-lock colours) I think you can do something like this: (let ((faces `((default ...) (cursor ...) ...))) (apply 'custom-theme-set-faces 'Darkula faces))