GNU bug report logs - #78583
31.0.50; emacs --fg-daemon not protecting frame F1

Previous Next

Package: emacs;

Reported by: Madhu <enometh <at> meer.net>

Date: Sun, 25 May 2025 05:43:02 UTC

Severity: normal

Found in version 31.0.50

Done: martin rudalics <rudalics <at> gmx.at>

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Madhu <enometh <at> meer.net>
Cc: 78583 <at> debbugs.gnu.org
Subject: bug#78583: 31.0.50; emacs --fg-daemon not protecting frame F1
Date: Tue, 27 May 2025 18:28:39 +0200
> On another note, I still believe that in daemonized emacs the F1 frame
> is special and should never be deleted by regular frame commands, (it
> should still be possible, but only after warning and user
> confirmation).  Would you agree? or perhaps you can suggest how best
> this may be done. --Best Regards, Madhu

I can offer the below.  It would have to be documented somewhere in the
daemon/emacsclient section.  After all (delete-frame terminal-frame) can
be used to kill the daemon - I never use emacsclient so I have no idea
whether and how useful that would be.

martin


diff --git a/src/frame.c b/src/frame.c
index f2acb19c77d..7a07f538d9f 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -2481,6 +2481,8 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
       else
 	error ("Attempt to delete the only frame");
     }
+  else if (IS_DAEMON && FRAME_INITIAL_P (f) && NILP (force))
+    error ("Attempt to delete daemon's initial frame");
 #ifdef HAVE_X_WINDOWS
   else if ((x_dnd_in_progress && f == x_dnd_frame)
 	   || (x_dnd_waiting_for_finish && f == x_dnd_finish_frame))




This bug report was last modified 6 days ago.

Previous Next


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