emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 526c2621498 1/2: Check daemon is initialized before suppressing i


From: Eli Zaretskii
Subject: master 526c2621498 1/2: Check daemon is initialized before suppressing its init errors
Date: Sat, 24 Feb 2024 04:27:46 -0500 (EST)

branch: master
commit 526c262149839702b94253d5eff195054ac5cd9e
Author: Spencer Baugh <sbaugh@janestreet.com>
Commit: Eli Zaretskii <eliz@gnu.org>

    Check daemon is initialized before suppressing its init errors
    
    Previously, the default error handler would correctly suppress
    unhandled errors raised when IS_DAEMON and the initial frame
    was current, since this is the normal state of operation for a
    daemon-mode Emacs.  However, this also incorrectly suppressed
    errors raised while a daemon-mode Emacs was starting up.
    
    Now, errors raised while a daemon-mode Emacs is starting up will be
    handled just like errors when a non-daemon Emacs is starting up.
    
    This was previously the case before changes for bug#1310 and
    bug#1836, which added the suppression of errors when IS_DAEMON.
    DAEMON_RUNNING didn't exist at the time of those changes, but now
    it does, so we can do better.
    
    * src/keyboard.c (Fcommand_error_default_function): Check
    !DAEMON_RUNNING in addition to IS_DAEMON.  (Bug#68799)
    * src/lisp.h (DAEMON_RUNNING): Add a clarifying comment about
    what this #define means.
---
 src/keyboard.c | 5 +++--
 src/lisp.h     | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/keyboard.c b/src/keyboard.c
index 4b5e20fb24c..eb0de98bad1 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1076,8 +1076,9 @@ Default value of `command-error-function'.  */)
             write to stderr and quit.  In daemon mode, there are
             many other potential errors that do not prevent frames
             from being created, so continuing as normal is better in
-            that case.  */
-         || (!IS_DAEMON && FRAME_INITIAL_P (sf))
+            that case, as long as the daemon has actually finished
+            initialization. */
+         || (!(IS_DAEMON && !DAEMON_RUNNING) && FRAME_INITIAL_P (sf))
          || noninteractive))
     {
       print_error_message (data, Qexternal_debugging_output,
diff --git a/src/lisp.h b/src/lisp.h
index 5fbbef80e8e..309bea02238 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -5153,6 +5153,7 @@ extern bool build_details;
 /* 0 not a daemon, 1 foreground daemon, 2 background daemon.  */
 extern int daemon_type;
 #define IS_DAEMON (daemon_type != 0)
+/* True means daemon-initialized has not yet been called. */
 #define DAEMON_RUNNING (daemon_type >= 0)
 #else  /* WINDOWSNT */
 extern void *w32_daemon_event;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]