From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Dave Goel Newsgroups: gmane.emacs.devel Subject: Re: Faces: How to clear an attribute while continuing to inherit other attributes? Date: Thu, 10 Oct 2019 13:50:33 -0400 Message-ID: References: <83tv8hrpi6.fsf@gnu.org> <83tv8gqz6u.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006d59950594920a6c" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="180438"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 10 19:50:58 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iIcaW-000klo-Kx for ged-emacs-devel@m.gmane.org; Thu, 10 Oct 2019 19:50:56 +0200 Original-Received: from localhost ([::1]:42772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIcaV-00079s-66 for ged-emacs-devel@m.gmane.org; Thu, 10 Oct 2019 13:50:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52500) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIcaO-00077J-Kn for emacs-devel@gnu.org; Thu, 10 Oct 2019 13:50:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIcaN-0005yS-CS for emacs-devel@gnu.org; Thu, 10 Oct 2019 13:50:48 -0400 Original-Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]:33994) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iIcaL-0005y4-Or; Thu, 10 Oct 2019 13:50:45 -0400 Original-Received: by mail-io1-xd31.google.com with SMTP id q1so15733479ion.1; Thu, 10 Oct 2019 10:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qTuZ2yutos2fYuSOWGliyU1xbTsyu75HlnAOXRaAuC0=; b=I2CbS4lnCV23cg5j9jXhvSlXyGs7Qy9QkDnr/zv3HqkgFmmW9QrHRvCiKbIr6HzVAj Rewca/59DZdWZ419GYOMsQgxsS3h8eeqlxUfR0X/Scl77BxbqrW/A/KKL8PPSWeBdR1p FXUu8jqDak2vew4rUHB7ekngiXPyTHIDCBDx0QHngUCCErCKFZDMb0AcWUoGi53oGocj 6qsFOJbmu1q7iz8za9jAw3tj02a8lODpXy5Oum8kC8iAHauttgLWlidxSnjA5Lr/zVwY jA4YAq4rDGUDaL1yTfxJ9GexrnKg7Tmkyz8o65gyAEbQPax7gL0W5rAFQpOQ3O7qjH3V eDSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qTuZ2yutos2fYuSOWGliyU1xbTsyu75HlnAOXRaAuC0=; b=aF/6fiYDjlyNO9L1qP9Z0UxV7OaAoFddQCmJ5dmbJ3QXmPPD2/9fp9SaV8sU8K75MX /LNXg8MGp+NNuuymuRI4jXNAYLW5Zy37/0yvfyqv8M2V7cYDuQ8YNUSUr43lZ//MCQuJ 4XLTj4u4LCpD0I+C5GbCunI6lVEwe5qs/x/gcgYQigmee29mkarAGxODYU7KsM8gQu6I YhLY49c7jV8liVenoQkZ/NpQvpcpDHbzaeKD8jp7/amv3Mcef1PxEXIq2qblYIYFfeC1 1eyR3v6DhzT00Bagu9dQRmKLS6ddjjc4nkLwiuFBwhAAs9EJvUinJLWMSUdio2XrDLoi mxXQ== X-Gm-Message-State: APjAAAWyZ0c4vGwm+HeZya4HGW5w564cafL6nhqBgithfU6Gam9UU7jx V4KoNXhDjWyHGARj+buJFidBaJ4nXNfEyhv5HpU1cH4t X-Google-Smtp-Source: APXvYqwzit6emWCy+PKrl+pJ+l7QaUFEfFcHPh7RfSgsToiRfwXTvdPgLII8SbGk7fYh7zH07GPd/LAF6eGQS/rpfsA= X-Received: by 2002:a02:b817:: with SMTP id o23mr11954080jam.42.1570729844626; Thu, 10 Oct 2019 10:50:44 -0700 (PDT) In-Reply-To: <83tv8gqz6u.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d31 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:240850 Archived-At: --0000000000006d59950594920a6c Content-Type: text/plain; charset="UTF-8" Of course, but that runs counter to the philosophy of inheritance. If you changed the default, you have to then go back and change all such faces. Again, if it was something like :underline or :bold or :height, you wouldn't see this problem: setting them to nil would remove any inheritance, and then, whenever you change the 'default face, your face's final resolved value automatically uses that. It seems that :fg and :bg also try to implement precisely that (providing a nil option as well as 'unspecified), but then don't do the final step correctly. It seems that the design of faces goes out of its way to carefully distinguish nil from 'unspecified, precisely to allow you to clear an attribute.. On Thu, Oct 10, 2019 at 1:37 PM Eli Zaretskii wrote: > > From: Dave Goel > > Date: Thu, 10 Oct 2019 11:56:21 -0400 > > Cc: emacs-devel@gnu.org > > > > > What do you mean by "default foreground" here? > > > > I mean: The foreground of the face called 'default. > > Then you could simply set the foreground of your face to be the same > as of the default face by using set-face-attribute, no? > --0000000000006d59950594920a6c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Of course, but that runs counter to the philo= sophy of inheritance. If you changed the default, you have to then go back = and change all such faces.=C2=A0

Again, if it was som= ething like :underline or :bold or :height, you wouldn't see this probl= em: setting them to nil would remove any inheritance, and then, whenever yo= u change the 'default face, your face's final resolved value automa= tically uses that. =C2=A0=C2=A0

It seems t= hat :fg and :bg also try to implement precisely that (providing a nil optio= n as well as 'unspecified), but then don't do the final step correc= tly.
=C2=A0
It seems that the design of fac= es goes out of its way to carefully distinguish nil from 'unspecified, = precisely to allow you to clear an attribute..




On Thu, Oct 10, 2019 at 1:37 PM Eli Zaret= skii <eliz@gnu.org> wrote:
> From: Dave Goel &= lt;deego3@gmail.com>
> Date: Thu, 10 Oct 2019 11:56:21 -0400
> Cc:
emacs-dev= el@gnu.org
>
> > What do you mean by "default foreground" here?
>
> I mean: The foreground of the face called 'default.

Then you could simply set the foreground of your face to be the same
as of the default face by using set-face-attribute, no?
--0000000000006d59950594920a6c--