[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Re: About the :distant-foreground face attribute

From: Chong Yidong
Subject: Re: [PATCH] Re: About the :distant-foreground face attribute
Date: Tue, 14 Jan 2014 16:47:37 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

> But I'd first like to hear Yidong's opinion on why it'd be better to
> fold the "alternate background" feature into the :foreground attribute
> rather than having it as a separate attribute.

1. Each aspect of a face should be controlled by one attribute, like
   :height (which can take either relative or absolute heights), and
   unlike :font vs :family (which has been a source of annoyance).

2. As currently implemented, :distant-foreground is the only attribute
   that can be `unspecified' even for the default face.  This breaks a
   nice and easily understandable rule, that `face-attribute' returns
   something specific for each attribute of the default face.

3. Neatness aside, if the alternative color stuff is supposed to be
   disabled by setting :distant-foreground to `unspecified', as it is
   now, then one cannot inherit from a face and then disable the
   alternative color specified by the parent.  If :distant-foreground is
   `unspecified' in the inheriting face, the parent's non-`unspecified'
   value of :distant-foreground takes effect.

   I suppose one could get around 2. and 3. by using a value of nil to
   disable the alternative color.  This then breaks the symmetry between
   :foreground and :distant-foreground, as the former does not take nil
   values (although `internal-set-lisp-face-attribute' accepts a nil
   value, that's only for 20.x background compatibility).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]