GNU bug report logs -
#51360
29.0.50; variable `server-name' initialized too late for use in init file
Previous Next
Reported by: Gregor Zattler <grfz <at> gmx.de>
Date: Sat, 23 Oct 2021 18:40:02 UTC
Severity: normal
Tags: moreinfo
Found in version 29.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 51360 in the body.
You can then email your comments to 51360 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#51360
; Package
emacs
.
(Sat, 23 Oct 2021 18:40:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Gregor Zattler <grfz <at> gmx.de>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sat, 23 Oct 2021 18:40:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Dear emacs developers, if emacs is started as a named daemon
like this: `emacs --damon=foo' or like this:
`emacsclient -a "" -s foo [...]' the variable `server-name'
is initialized with the name "foo" but too late to be used
in init.el:
Warning (initialization): An error occurred while loading ´/home/grfz/.config/emacs/init.el´:
Symbol's value as variable is void: server-name
It would be helpful if `server-name' would be initialized
early enough to be used in init.el in order to enable
conditional configuration of the server, depending on it's
name.
Thanks for your attention, Gregor
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#51360
; Package
emacs
.
(Sun, 24 Oct 2021 12:47:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 51360 <at> debbugs.gnu.org (full text, mbox):
Gregor Zattler <grfz <at> gmx.de> writes:
> Warning (initialization): An error occurred while loading ´/home/grfz/.config/emacs/init.el´:
>
> Symbol's value as variable is void: server-name
>
> It would be helpful if `server-name' would be initialized
> early enough to be used in init.el in order to enable
> conditional configuration of the server, depending on it's
> name.
Doesn't this just depend on when you call `server-start'?
Do you have a recipe for reproducing this?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#51360
; Package
emacs
.
(Sun, 24 Oct 2021 15:35:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 51360 <at> debbugs.gnu.org (full text, mbox):
Hi Stefan, emacs devs,
* Stefan Kangas <stefan <at> marxist.se> [2021-10-24; 05:46]:
> Gregor Zattler <grfz <at> gmx.de> writes:
>
>> Warning (initialization): An error occurred while loading ´/home/grfz/.config/emacs/init.el´:
>>
>> Symbol's value as variable is void: server-name
>>
>> It would be helpful if `server-name' would be initialized
>> early enough to be used in init.el in order to enable
>> conditional configuration of the server, depending on it's
>> name.
>
> Doesn't this just depend on when you call `server-start'?
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
Ciao,
--
Gregor
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#51360
; Package
emacs
.
(Sun, 24 Oct 2021 15:46:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 51360 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
>
> Warning (initialization): An error occurred while loading
> ´/home/grfz/.config/emacs/init.el´:
>
> Symbol's value as variable is void: server-name
>
You should (require 'server) before referring to server-name. None of the
defcustoms in server.el are autoloaded.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#51360
; Package
emacs
.
(Sun, 24 Oct 2021 16:00:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 51360 <at> debbugs.gnu.org (full text, mbox):
> From: Gregor Zattler <grfz <at> gmx.de>
> Date: Sun, 24 Oct 2021 17:34:19 +0200
> Cc: 51360 <at> debbugs.gnu.org
>
> 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.
Added tag(s) moreinfo.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sun, 24 Oct 2021 17:52:04 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#51360
; Package
emacs
.
(Sun, 24 Oct 2021 19:44:02 GMT)
Full text and
rfc822 format available.
Message #22 received at 51360 <at> debbugs.gnu.org (full text, mbox):
Hi Gregory, emacs devs,
* Gregory Heytings <gregory <at> heytings.org> [2021-10-24; 15:45]:
>> Warning (initialization): An error occurred while loading
>> ´/home/grfz/.config/emacs/init.el´:
>>
>> Symbol's value as variable is void: server-name
>
> You should (require 'server) before referring to server-name. None of the
> defcustoms in server.el are autoloaded.
thanks. Requiring server prevents this error, but `server-name'
is not set to the command line value, though:
~$ cat ~/.emacs
(require 'server)
(when (equal server-name "foo") (setq greeting "My name is foo!"))
~$ emacsclient -a "" -s foo --eval '(message greeting)'
emacsclient: Should XDG_RUNTIME_DIR='/run/user/1000' be in the environment?
emacsclient: (Be careful: XDG_RUNTIME_DIR is security-related.)
emacsclient: can't find socket; have you started the server?
emacsclient: To start the server in Emacs, type "M-x server-start".
Starting Emacs daemon.
Emacs daemon should have started, trying to connect again
*ERROR*: Symbol's value as variable is void: greeting
Ciao,
--
Gregor
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#51360
; Package
emacs
.
(Sun, 24 Oct 2021 20:01:01 GMT)
Full text and
rfc822 format available.
Message #25 received at 51360 <at> debbugs.gnu.org (full text, mbox):
Hi Eli, emacs devs,
* Eli Zaretskii <eliz <at> gnu.org> [2021-10-24; 18:59]:
>> From: Gregor Zattler <grfz <at> gmx.de>
>> Date: Sun, 24 Oct 2021 17:34:19 +0200
>> Cc: 51360 <at> debbugs.gnu.org
>>
>> 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
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#51360
; Package
emacs
.
(Mon, 25 Oct 2021 02:28:01 GMT)
Full text and
rfc822 format available.
Message #28 received at 51360 <at> debbugs.gnu.org (full text, mbox):
> From: Gregor Zattler <grfz <at> gmx.de>
> Date: Sun, 24 Oct 2021 22:00:21 +0200
>
> > 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
Sorry, I don't think I follow: what has intuition got to do with this?
And what do you mean by "initialise the emacs daemon"? -- that happens
out of your control, in the internal Emacs code.
> But you are right that works. Thanks.
So does this mean your problem is solved?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#51360
; Package
emacs
.
(Mon, 25 Oct 2021 08:03:01 GMT)
Full text and
rfc822 format available.
Message #31 received at 51360 <at> debbugs.gnu.org (full text, mbox):
[sorry for second post, first did not include bug address]
Hi Eli, emacs devs,
* Eli Zaretskii <eliz <at> gnu.org> [2021-10-25; 05:27]:
>> From: Gregor Zattler <grfz <at> gmx.de>
>> Date: Sun, 24 Oct 2021 22:00:21 +0200
>>
>> > 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
>
> Sorry, I don't think I follow: what has intuition got to do with this?
> And what do you mean by "initialise the emacs daemon"? -- that happens
> out of your control, in the internal Emacs code.
>
>> But you are right that works. Thanks.
>
> So does this mean your problem is solved?
Yes, thanks. Please close the bug report.
Ciao,
--
Gregor
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Mon, 25 Oct 2021 12:43:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Gregor Zattler <grfz <at> gmx.de>
:
bug acknowledged by developer.
(Mon, 25 Oct 2021 12:43:02 GMT)
Full text and
rfc822 format available.
Message #36 received at 51360-done <at> debbugs.gnu.org (full text, mbox):
> From: Gregor Zattler <grfz <at> gmx.de>
> Date: Mon, 25 Oct 2021 10:02:16 +0200
>
> > So does this mean your problem is solved?
>
> Yes, thanks. Please close the bug report.
Thanks, closing.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 23 Nov 2021 12:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 3 years and 205 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.