unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Tim Cross <theophilusx@gmail.com>, Eli Zaretskii <eliz@gnu.org>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: RE: [External] : Re: Defaulting faces to inherit deemed harmful [was: Stealing a default face from a non-ELPA package]
Date: Sun, 6 Mar 2022 02:35:39 +0000	[thread overview]
Message-ID: <SJ0PR10MB5488DB3E425C3847C2AA74B7F3079@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <87tuccdn1q.fsf@gmail.com>

> Well I don't have a problem per se. I was mainly responding to Drew's
> claim that defining faces to use inheritance was harmful.

To be fair (in spite of the abbreviated and
tongue-in-cheek Subject line) what I really
suggested was _less predefining_ of faces
with inheritance.

I responded to your post saying you would
prefer that "_more_ packages would define
their faces in terms of inheritance from
standard/built-in faces."  Where you would
like more to do that, I'd like fewer to.

> The issue is many packages only do an extremely simplistic
> default face definition.

If "simplistic" means not imposing inheritance
by default, then good for them.  In general,
it's better not to couple a face's default
definition to another face's definition (for
the reasons I gave).

> For example, just setting the foreground to a colour which looks good for
> the theme they are using and not using the facilities available to set
> the default based on whether the user is running in a GUI frame, inside
> a terminal, on the GNU Linux console or whether they are using a dark
> or light theme.

That's something entirely different from 
whether to inject inheritance into a face's
default definition.

I happen to agree with everything in your last
paragraph.  It's just unrelated to whether it's
good or bad to define face X as inheriting from
face Y by default.

Except that of course any decision to inherit
from another face by default should involve
attention to the things you mention.  The same
attention should be paid when considering all
face attributes.

> I suspect this is because doing a proper default face
> setting which works across different environments and light or dark
> themes can be complex.

Yes, I think so.  The same problem exists for
defining the types of defcustoms.  Many, many
(most?) could stand to be refined a bit, to be
more useful.

> If on the other hand, their default just
> inherits from one of the built-in faces which typically do take 
> these factors into account, it would provide increased consistency

I suppose that's true.  But that's another
lazy way out - like what you decry - even if
it's more likely not to be flaky.

> So basically, my argument is EITHER define the face so that the default
> works well regardless of whether the user is running in GUI, terminal,
> console or a light/dark theme

Just leave it at that.  The message should be
to just take face attributes seriously when
defining defaults.  Including :inherit.

> don't just make the default a simple :foreground "xxxx", which will only work
> well if the user happens to use a similar environment and light or dark
> theme as the author.

It's really not that hard to choose a default
color for dark if you only use light, or vice
versa.

It's best of course to test/try both.  But even
just using a color complement for the opposite
`background-mode' can be pretty good.  (And it's
simple to obtain: `color-complement-hex'.)



  reply	other threads:[~2022-03-06  2:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-05 16:46 Defaulting faces to inherit deemed harmful [was: Stealing a default face from a non-ELPA package] Drew Adams
2022-03-05 18:38 ` Tim Cross
2022-03-05 19:40   ` Eli Zaretskii
2022-03-05 22:27     ` Tim Cross
2022-03-06  2:35       ` Drew Adams [this message]
2022-03-05 20:17   ` [External] : " Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SJ0PR10MB5488DB3E425C3847C2AA74B7F3079@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=theophilusx@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).