[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: Drew Adams
Subject: RE: [PATCH] Re: About the :distant-foreground face attribute
Date: Mon, 13 Jan 2014 15:01:57 -0800 (PST)

> Yes, but font-lock colors are specified with explicit colors (even
> in the default "theme"), and we want to preserve these even in the
> presence of a selection. 

I, for one, do not want that.  I want region highlighting to
correctly show which characters have been selected - each character.
Region highlighting should never be overridden by font-lock
highlighting.  UI-101: Intro to User Interfaces.

> At the same time, we want to make sure that highlighted text is
> legible against a background of whatever the system selection color
> happens to be.

Then choose the `region' background accordingly.  If Emacs cannot
do that automatically in the case of some platforms, too bad - let
users compensate by setting `region' manually.  They should always
be the ultimate judge of what works best for them.

> The best way to do that is to automatically shift the foreground
> colors in value, but not hue, so that they remain legible while
> being recognizably the same color.

No.  The best way to do that is to let users do it - let their
preferences rule.  Users do not need Emacs changing whatever values
they set for the `region' face.

And if you say that your new feature does not override user preference
for `region', how can you determine that?  You cannot just compare the
current value to the standard value, since the standard value might in
fact be just what the user wants.  Who are we to say we know better
than the user?

> I think the results are actually pretty good.

That does not sound like a ringing endorsement.  Does that mean that
only 25% of user preferences are ignored?  10%?

> If a particular theme doesn't want to use automatic color adjustment,
> it can specify its own :contrast-function and do whatever it wants.

So if it does not specify a :contrast-function, you take that as a
license to impose a standard one, instead of as a preference to not
perform any :contrast-function twiddling at all?

> I would also support a scheme where, by default, 'region' sets
> foreground *and* background colors to the system selection colors
> and other faces don't show through. But we didn't decide to go in that
> direction.

How about supporting the time-worn "scheme" whereby users and Lisp
code can specify clearly what the region highlighting foreground and
background are, literally, with nothing hidden behind their backs
playing tricks on them?  IOW, treat `region' like other faces, and
treat its foreground and background equally.

> > If you talk about other themes, they can set :distant-foreground
> > to a real color of their choosing and not rely on some automatically
> > generated one which most probably don't fit the theme anyway.
> > Automatically generated colors are a crutch which should be avoided
> > if possible, certainly not recommended.
> There's no way that themes can take into account all the possible
> colors users and packages might use. Automatic contrast adjustment
> can do that.

Bzzzzzt!  No, but thanks for playing.  Automatic contrast adjustment
can never respect all user (or package) `region' specs, precisely
because it *automatically adjusts* the appearance away from what users
(or packages) specify.

> If you want the :distant-foreground behavior, it can be accommodated
> in this patch. This patch also permits other schemes that some users
> might find more useful. We should push policy to user customization
> when possible instead of hardcoding policy in the logic of face
> attributes.

We should leave face specs defined by users and packages well enough
alone.  Let them decide what they want - and let them get what they
want, without the "benefit" of behind-the-back twiddling.  Users
deserve honest transparency, not parlor magic tricks.

reply via email to

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