GNU bug report logs - #76772
29.4; Emacsclient doesn't display warnings emitted during daemon startup

Previous Next

Package: emacs;

Reported by: Artiom Balan <artiombalan331 <at> gmail.com>

Date: Thu, 6 Mar 2025 04:48:04 UTC

Severity: wishlist

Tags: confirmed

Found in version 29.4

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Artiom Balan <artiombalan331 <at> gmail.com>
Cc: 76772 <at> debbugs.gnu.org, stefankangas <at> gmail.com
Subject: Re: bug#76772: 29.4; Emacsclient doesn't display warnings emitted
 during daemon startup
Date: Sun, 09 Mar 2025 12:35:51 +0200
> From: Artiom Balan <artiombalan331 <at> gmail.com>
> Date: Sat, 8 Mar 2025 10:53:38 +0200
> Cc: Stefan Kangas <stefankangas <at> gmail.com>, 76772 <at> debbugs.gnu.org
> 
> > If we want the first client connection to show the important messages
> > from the startup phase of the daemon, then warnings is not the only
> > thing, and not even the most important thing, that needs to be shown.
> 
> Good point. To generalize, is the only difference between running a regular emacs instance and running an
> emacs daemon the fact that the user doesn't see some things? Like, the behavior is the same, but some
> things are "shown" in the daemon, which the user can't see. If so, how can we know which are all of these
> things? You added errors and echo-area messages. Are there any others?

When some code in Emacs shows a message, we don't usually make sure
the message is displayed.  We call the usual functions like 'message'
or pop-to-buffer, and if the selected frame is not shown on display,
we leave it at that.

So in general, the daemon doesn't show anything, with the exception of
critical problems that prevent it from starting (those are written to
stderr of the controlling terminal at the moment of daemon startup).

> Would the ideal solution be to show in the first emacsclient everything that the regular instance would have
> shown? Or maybe a hack that displays the warnings (and errors?) in the first emacsclient would suffice? 

I think we should have some way of deferring messages until some frame
is visible on display.

> BTW, how can i get emacs to show errors after startup? I tried to add a `(error "message")` to my init.el, and
> starting emacs would show it as a warning: 
> "Warning (initialization): An error occurred while loading ..."

Signaling an error during startup prevents Emacs from starting, so the
user will not see any messages at all, which is not useful.
Therefore, Emacs handles errors during startup in a special way.  If
you want Emacs to enter a debugger due to problem in startup and/or
init files, use the --debug-init command-line option to start Emacs.




This bug report was last modified 103 days ago.

Previous Next


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