bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#58909: 29.0.50; [WIP PATCH] Deleting the last frame of an emacsclien


From: Jim Porter
Subject: bug#58909: 29.0.50; [WIP PATCH] Deleting the last frame of an emacsclient doesn't ask to save
Date: Wed, 2 Nov 2022 09:36:52 -0700

On 11/2/2022 5:16 AM, Eli Zaretskii wrote:
Date: Tue, 1 Nov 2022 15:39:29 -0700
From: Jim Porter <jporterbugs@gmail.com>
Cc: 58909@debbugs.gnu.org

Attached is a (hopefully) safer version of my change to 'delete-frame'.
In this patch, a hook can only cancel frame deletion if FORCE is
non-nil. This way, if there were ever some bug with a hook, you (or some
code) can still force-delete the frame.

Sorry, but I still don't like this.  We currently call this hook via
safe_call because we don't want to let the hook prevent the deletion
of the frame.

I prefer to solve this in server.el, not in lower-level primitives.

Hm, ok. That means I'd need to make sure 'C-x 5 0' calls something other than 'delete-frame', so that I could add a prompt to it that can prevent deletion of the frame.

Two questions then:

1. If 'delete-frame' is a lower-level primitive, should 'C-x 5 0' call it directly, or should there be a higher-level function for it to call? If we had some higher-level function, then user-level commands could call that, but low-level code could still use 'delete-frame'. This user-level command would then be able to run some hook that can prevent deletion of the frame.

2. Since server.el has a minor mode (unsurprisingly named 'server-mode'), maybe one option is to do command remapping. If we remap 'delete-frame' to some new 'server-delete-frame' when 'server-mode' is active, then this should work. See attached for a quick sketch of how this would look.

What do you think about one of these?

Attachment: 0001-WIP-Try-using-a-keymap-for-server-mode.patch
Description: Text document


reply via email to

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