Subject: Re: bug#47133: 28.0.50; Library chart: colors sometimes appear, sometimes not

From: Eli Zaretskii <[email-masked]>
Date: Thu, 18 Mar 2021 11:43:47 +0200

> From: Lars Ingebrigtsen <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Thu, 18 Mar 2021 10:28:20 +0100
> 
> Lars Ingebrigtsen <[email-masked]> writes:
> 
> > It's more about not having a display, I suspect.
> >
> > ./src/emacs -geometry -0+0 -Q --daemon=server -l chart
> >
> > will make chart-face-list nil.
> 
> (I.e., initialising a variable based on `display-color-p' or
> `display-graphic-p' is almost always the wrong thing to do -- things
> depending on these should be computed dynamically at use time.)

We have custom-reevaluate-setting for that: could it help?  At least
for defcustoms which are initialized using those APIs?

In general, stuff that depends on having a GUI frame needs to be done
in server-after-make-frame-hook to work in sessions that start as
daemon.  maybe we should have some infrastructure for doing some of
that automatically, so that users won't need to put so many things
into that hook.