GNU bug report logs - #68799
30.0.50; emacs --fg-daemon fails silently if server-start fails

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Mon, 29 Jan 2024 16:55:02 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #62 received at 68799 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Spencer Baugh <sbaugh <at> janestreet.com>
Cc: 68799 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, jasonr <at> gnu.org
Subject: Re: bug#68799: 30.0.50; emacs --fg-daemon fails silently if
 server-start fails
Date: Tue, 13 Feb 2024 21:46:02 +0200
> From: Spencer Baugh <sbaugh <at> janestreet.com>
> Cc: 68799 <at> debbugs.gnu.org,  monnier <at> iro.umontreal.ca,  jasonr <at> gnu.org
> Date: Tue, 13 Feb 2024 13:04:24 -0500
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Using DAEMON_RUNNING would mean any errors while starting the server
> > will fail to show the explicit error message about that.  That's a
> > regression in my book.  So I hope we can find a better solution.
> 
> Could you be more specific about what would regress in this situation?
> Preferably with a step by step of something that behaves worse.

I mean this error message:

  (let ((dn (daemonp)))
    (when dn
      (when (stringp dn) (setq server-name dn))
      (server-start)
      (if server-process
	  (daemon-initialized)
	(if (stringp dn)
	    (message
	     "Unable to start daemon: Emacs server named %S already running"
	     server-name)
	  (message "Unable to start the daemon.\nAnother instance of Emacs is running the server, either as daemon or interactively.\nYou can use emacsclient to connect to that Emacs process."))
	(kill-emacs 1))))

> Currently the error message doesn't get shown at all, so I'm not clear
> what could be regressing.

We already established why the message doesn't show: because errors in
server-start are not caught.  I thought we also agreed that catching
the errors there and letting startup.el show the above error messages
is something that should be done.  I think your patch will prevent us
from doing that because the code which you suggest to patch with
DAEMON_RUNNING will kill Emacs before startup.el gets the chance to
show the error message, because daemon-initialized has not yet been
run by that time.




This bug report was last modified 1 year and 86 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.