Eli Zaretskii writes: >> From: Spencer Baugh >> Cc: 68799@debbugs.gnu.org >> Date: Mon, 29 Jan 2024 12:32:00 -0500 >> >> Eli Zaretskii writes: >> >> >> So the problem seems to be that somehow server-start succeeds to leave >> >> a non-nil server-process variable behind, although testing that is the >> >> documented way of telling whether server is running. >> > >> > Or maybe server-start signals an error, and then the code which shows >> > an error message and shuts down Emacs doesn't get run? >> >> Yes, that's exactly what happens. >> >> So should we wrap a condition-case around server-start, I suppose? > > Probably. But perhaps we should also modify server-start so that, > when it is called from a daemon, it signals in this case a distinct > error, which startup.el could then detect and display a friendly error > message. Actually, it seems that main() already does a fputs ("Error: server did not start correctly\n", stderr); if the server process exits non-zero. So we already get a nice: Starting Emacs daemon. Creating directory: Permission denied, /nonexistent Error: server did not start correctly So I think the below patch suffices.