Subject: Re: bug#51360: 29.0.50; variable `server-name' initialized too late for use in init file

From: Gregor Zattler <[email-masked]>
Date: Sun, 24 Oct 2021 22:00:21 +0200

Hi Eli, emacs devs,
* Eli Zaretskii <[email-masked]> [2021-10-24; 18:59]:
>> From: Gregor Zattler <[email-masked]>
>> Date: Sun, 24 Oct 2021 17:34:19 +0200
>> Cc: [email-masked]
>>
>> When emacs is started with emacs --daemon=foo (or
>> emacsclinet -a "" -s foo [...]) one does not use
>> `server-start'.
>>
>> > Do you have a recipe for reproducing this?
>>
>> Have
>>
>> (when (equal server-name "foo") (message "My name is foo!"))
>>
>> in .emacs and start emacs with   emacs --daemon=foo
>
> Whatever you do that you need server-name for, can't you do that in
> emacs-startup-hook?  AFAIR, that gets called after the daemon already
> finished its initialization and provided its name to Emacs, so
> server-name should be already populated.

the idea is to initialise the emacs daemon depending on it's
server-name.  Therefore doing it via emacs-startup-hook is
somewhat counter-intuitive

But you are right that works.  Thanks.

Ciao,
--
Gregor