GNU bug report logs -
#78583
31.0.50; emacs --fg-daemon not protecting frame F1
Previous Next
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>
To reply to this bug, email your comments to 78583 AT debbugs.gnu.org.
There is no need to reopen the bug first.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78583
; Package
emacs
.
(Sun, 25 May 2025 05:43:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Madhu <enometh <at> meer.net>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 25 May 2025 05:43:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
$ emacs --fg-daemon=foo &
$ emacsclient -n -c -s foo &
on the graphical frame
1. type M-: (frame-list) ;; two frames
2. C-x 5 1
3. type M-: (frame-list) ;; only one frame. The previous
step shouldn't have deleted Frame F1.
I noticed this on master on (may 10 2025) commit 6699062.
I'm sure this worked on master on feb 13 2025, commit b8c8ae92 but I
couldn't check the previous emacs-31.0.4.x binaries are unusable because
of unrelated elisp changes. --Madhu
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78583
; Package
emacs
.
(Tue, 27 May 2025 08:59:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 78583 <at> debbugs.gnu.org (full text, mbox):
> $ emacs --fg-daemon=foo &
> $ emacsclient -n -c -s foo &
>
> on the graphical frame
> 1. type M-: (frame-list) ;; two frames
> 2. C-x 5 1
> 3. type M-: (frame-list) ;; only one frame. The previous
> step shouldn't have deleted Frame F1.
>
> I noticed this on master on (may 10 2025) commit 6699062.
>
> I'm sure this worked on master on feb 13 2025, commit b8c8ae92 but I
> couldn't check the previous emacs-31.0.4.x binaries are unusable because
> of unrelated elisp changes. --Madhu
Hopefully fixed now. Please try again.
Thanks for the report, martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78583
; Package
emacs
.
(Tue, 27 May 2025 10:09:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 78583 <at> debbugs.gnu.org (full text, mbox):
* martin rudalics <ac389488-26a6-4861-961e-eb7b63913355 <at> gmx.at>
Wrote on Tue, 27 May 2025 10:57:58 +0200
> Hopefully fixed now. Please try again.
Thanks for the quick response, it would fix the regression.
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
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78583
; Package
emacs
.
(Tue, 27 May 2025 16:29:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 78583 <at> debbugs.gnu.org (full text, mbox):
> 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))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78583
; Package
emacs
.
(Wed, 28 May 2025 10:57:03 GMT)
Full text and
rfc822 format available.
Message #17 received at 78583 <at> debbugs.gnu.org (full text, mbox):
> Cc: 78583 <at> debbugs.gnu.org
> Date: Tue, 27 May 2025 18:28:39 +0200
> From: martin rudalics via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>
> > 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.
Is this indeed a recent regression? If so, can we restore previous
behavior (which was what, btw)?
If this is not a regression, i.e. killing the initial frame in a
daemon session was previously allowed, then I don't think we should
signal an error. We might ask for confirmation, but even then I'm not
sure. If someone wants to kill that frame, why should Emacs protest?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78583
; Package
emacs
.
(Wed, 28 May 2025 14:02:09 GMT)
Full text and
rfc822 format available.
Message #20 received at 78583 <at> debbugs.gnu.org (full text, mbox):
will have to anser that.>> 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.
>
> Is this indeed a recent regression?
No.
> If so, can we restore previous
> behavior (which was what, btw)?
>
> If this is not a regression, i.e. killing the initial frame in a
> daemon session was previously allowed, then I don't think we should
> signal an error. We might ask for confirmation, but even then I'm not
> sure. If someone wants to kill that frame, why should Emacs protest?
Maybe Madhu can tell us.
martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78583
; Package
emacs
.
(Wed, 28 May 2025 15:04:01 GMT)
Full text and
rfc822 format available.
Message #23 received at 78583 <at> debbugs.gnu.org (full text, mbox):
* martin rudalics <afdfc9ce-f4b4-42f2-bc27-a210d356a8f7 <at> gmx.at>
Wrote on Wed, 28 May 2025 16:01:03 +0200
>> If this is not a regression, i.e. killing the initial frame in a
>> daemon session was previously allowed, then I don't think we should
>> signal an error. We might ask for confirmation, but even then I'm not
>> sure. If someone wants to kill that frame, why should Emacs protest?
>
> Maybe Madhu can tell us.
Because if F1 is deleted emacs can no longer function as a daemon --
it cannot be detached. It now has to be attached to some termminal.
One should assume that this is not what is required by the user who
started emacs in daemon mode. I believe this is a defect in the
original implemenataion of daemonised emacs. --Madhu
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78583
; Package
emacs
.
(Wed, 28 May 2025 15:51:01 GMT)
Full text and
rfc822 format available.
Message #26 received at 78583 <at> debbugs.gnu.org (full text, mbox):
> Date: Wed, 28 May 2025 20:33:02 +0530 (IST)
> Cc: eliz <at> gnu.org, 78583 <at> debbugs.gnu.org
> From: Madhu <enometh <at> meer.net>
>
> * martin rudalics <afdfc9ce-f4b4-42f2-bc27-a210d356a8f7 <at> gmx.at>
> Wrote on Wed, 28 May 2025 16:01:03 +0200
>
> >> If this is not a regression, i.e. killing the initial frame in a
> >> daemon session was previously allowed, then I don't think we should
> >> signal an error. We might ask for confirmation, but even then I'm not
> >> sure. If someone wants to kill that frame, why should Emacs protest?
> >
> > Maybe Madhu can tell us.
>
> Because if F1 is deleted emacs can no longer function as a daemon --
> it cannot be detached. It now has to be attached to some termminal.
> One should assume that this is not what is required by the user who
> started emacs in daemon mode. I believe this is a defect in the
> original implemenataion of daemonised emacs. --Madhu
I understand, but I don't see why this should be forbidden.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78583
; Package
emacs
.
(Thu, 29 May 2025 01:13:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 78583 <at> debbugs.gnu.org (full text, mbox):
* Eli Zaretskii <eliz <at> gnu.org> <86cybswx89.fsf <at> gnu.org>
> I understand, but I don't see why this should be forbidden.
It should not. (as I said "(it should still be possible, but only
after warning and user confirmation).")
Maybe it is possible to do this via delete-frame-functions.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78583
; Package
emacs
.
(Thu, 29 May 2025 06:25:02 GMT)
Full text and
rfc822 format available.
Message #32 received at 78583 <at> debbugs.gnu.org (full text, mbox):
> Date: Thu, 29 May 2025 06:42:57 +0530 (IST)
> Cc: rudalics <at> gmx.at, 78583 <at> debbugs.gnu.org
> From: Madhu <enometh <at> meer.net>
>
> * Eli Zaretskii <eliz <at> gnu.org> <86cybswx89.fsf <at> gnu.org>
> > I understand, but I don't see why this should be forbidden.
>
> It should not. (as I said "(it should still be possible, but only
> after warning and user confirmation).")
>
> Maybe it is possible to do this via delete-frame-functions.
Patches to that effect are welcome, but I hope we all agree that this
is not a regression, just a potentially dangerous operation that was
always allowed, and which we now would like to be protected by a
confirmation prompt.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78583
; Package
emacs
.
(Thu, 29 May 2025 07:04:02 GMT)
Full text and
rfc822 format available.
Message #35 received at 78583 <at> debbugs.gnu.org (full text, mbox):
> I understand, but I don't see why this should be forbidden.
In the patch I posted it's not forbidden. Users would just have to set
the FORCE flag in order to delete F1.
martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78583
; Package
emacs
.
(Thu, 29 May 2025 08:01:02 GMT)
Full text and
rfc822 format available.
Message #38 received at 78583 <at> debbugs.gnu.org (full text, mbox):
> Date: Thu, 29 May 2025 09:03:34 +0200
> Cc: 78583 <at> debbugs.gnu.org
> From: martin rudalics <rudalics <at> gmx.at>
>
> > I understand, but I don't see why this should be forbidden.
>
> In the patch I posted it's not forbidden. Users would just have to set
> the FORCE flag in order to delete F1.
I think we could install this and see if it causes any trouble, but
please call out the change as incompatible in NEWS. The doc string
should also be updated to mention that FORCE is now meaningful in this
case as well.
Thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78583
; Package
emacs
.
(Thu, 29 May 2025 09:37:02 GMT)
Full text and
rfc822 format available.
Message #41 received at 78583 <at> debbugs.gnu.org (full text, mbox):
> I think we could install this and see if it causes any trouble, but
> please call out the change as incompatible in NEWS. The doc string
> should also be updated to mention that FORCE is now meaningful in this
> case as well.
I tried to do what you asked for. Please have a look.
Thanks, martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78583
; Package
emacs
.
(Thu, 29 May 2025 09:45:01 GMT)
Full text and
rfc822 format available.
Message #44 received at 78583 <at> debbugs.gnu.org (full text, mbox):
> Date: Thu, 29 May 2025 11:35:45 +0200
> Cc: enometh <at> meer.net, 78583 <at> debbugs.gnu.org
> From: martin rudalics <rudalics <at> gmx.at>
>
> > I think we could install this and see if it causes any trouble, but
> > please call out the change as incompatible in NEWS. The doc string
> > should also be updated to mention that FORCE is now meaningful in this
> > case as well.
>
> I tried to do what you asked for. Please have a look.
Perfect, thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78583
; Package
emacs
.
(Sat, 07 Jun 2025 08:51:01 GMT)
Full text and
rfc822 format available.
Message #47 received at 78583 <at> debbugs.gnu.org (full text, mbox):
> Cc: enometh <at> meer.net, 78583 <at> debbugs.gnu.org
> Date: Thu, 29 May 2025 12:44:20 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
>
> > Date: Thu, 29 May 2025 11:35:45 +0200
> > Cc: enometh <at> meer.net, 78583 <at> debbugs.gnu.org
> > From: martin rudalics <rudalics <at> gmx.at>
> >
> > > I think we could install this and see if it causes any trouble, but
> > > please call out the change as incompatible in NEWS. The doc string
> > > should also be updated to mention that FORCE is now meaningful in this
> > > case as well.
> >
> > I tried to do what you asked for. Please have a look.
>
> Perfect, thanks.
Any reasons not to close this bug now?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78583
; Package
emacs
.
(Sat, 07 Jun 2025 15:05:02 GMT)
Full text and
rfc822 format available.
Message #50 received at 78583 <at> debbugs.gnu.org (full text, mbox):
* Eli Zaretskii <eliz <at> gnu.org> <86plfghr51.fsf <at> gnu.org>
Wrote on Sat, 07 Jun 2025 11:50:34 +0300
> Any reasons not to close this bug now?
No, Of course not. (speaking for myself)
Reply sent
to
martin rudalics <rudalics <at> gmx.at>
:
You have taken responsibility.
(Sun, 08 Jun 2025 06:57:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Madhu <enometh <at> meer.net>
:
bug acknowledged by developer.
(Sun, 08 Jun 2025 06:57:02 GMT)
Full text and
rfc822 format available.
Message #55 received at 78583-done <at> debbugs.gnu.org (full text, mbox):
>> Any reasons not to close this bug now?
>
> No, Of course not. (speaking for myself)
Closing.
Thanks, martin
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.