Subject: bug#23689: Daemon-mode on Windows - "w32-initialized" is set too early

From: Paul Moore <[email-masked]>
Date: Sat, 4 Jun 2016 11:29:28 +0100

On 4 June 2016 at 11:07, Eli Zaretskii <[email-masked]> wrote:
>> From: Paul Moore <[email-masked]>
>> Date: Fri, 3 Jun 2016 11:33:00 +0100
>>
>> When Emacs starts in daemon mode on Windows, "w32-initialized" is set
>> to "t" right at the start - before the window system is initialized.
>> Specifically, before (find-font) will work correctly.
>>
>> To demonstrate, start Emacs in daemon mode, with a .emacs.d/init.el
>> containing a statement at the top to display the value of
>> "w32-initialized". The value "t" is shown.
>
> It looks like this is an internal variable whose purpose is to make
> sure the w32 GUI initialization code is called only once per session;
> it shouldn't be used for any other purpose.  I guess we could make
> this more explicit in the doc string, but other than that I see no bug
> here.

OK. The spacemacs initialisation code uses this variable (along with
ns-initialized and x-initialized) to ensure that certain actions (e.c.
find-font) are only run after the display is initialized. It's only
w32-initialized for which this approach doesn't work. Is there a
better way of testing for this situation that should be used?

Paul