From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#58909: 29.0.50; [WIP PATCH] Deleting the last frame of an emacsclient doesn't ask to save Date: Wed, 02 Nov 2022 20:42:20 +0200 Message-ID: <835yfx9p0z.fsf@gnu.org> References: <9a70f868-ca50-52fc-af3e-23813af104f2@gmail.com> <83zgdcduxm.fsf@gnu.org> <53238b5b-3e0a-3dfe-eeba-f37cafa81f50@gmail.com> <838rkveq3n.fsf@gnu.org> <7de45884-b4c9-4a4c-777c-5db17b3bacca@gmail.com> <835yfzeobt.fsf@gnu.org> <7694fcf2-8982-9099-5eb8-39835d049847@gmail.com> <83y1svch5u.fsf@gnu.org> <0dc07894-dfa1-01f6-87c4-9e02bfcaf0dc@gmail.com> <83bkppblh7.fsf@gnu.org> <83a6599t7m.fsf@gnu.org> <39e03350-2783-fa90-5d66-26e47abe100d@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21020"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58909@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 02 19:43:12 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oqIhk-0005H1-6O for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 02 Nov 2022 19:43:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqIhb-00061o-Pv; Wed, 02 Nov 2022 14:43:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqIha-00061f-3l for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2022 14:43:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqIhZ-0004K7-RX for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2022 14:43:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oqIhZ-0000Iu-N0 for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2022 14:43:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Nov 2022 18:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58909 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 58909-submit@debbugs.gnu.org id=B58909.16674145601136 (code B ref 58909); Wed, 02 Nov 2022 18:43:01 +0000 Original-Received: (at 58909) by debbugs.gnu.org; 2 Nov 2022 18:42:40 +0000 Original-Received: from localhost ([127.0.0.1]:47194 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqIhE-0000IG-5s for submit@debbugs.gnu.org; Wed, 02 Nov 2022 14:42:40 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqIhB-0000Hx-T0 for 58909@debbugs.gnu.org; Wed, 02 Nov 2022 14:42:38 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqIh4-0004HM-K2; Wed, 02 Nov 2022 14:42:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=djRMnNovpkfchA62lsXr2J61dwt0+5kuycFAOnMC/ag=; b=PxqyWU8ZAwYT QZMl5PL/WJR7D3yN9ZIIuTSEE/QzDDhP7Flm1djUTHJDMSdksV8IPd5Te72AwYv4ooMG1tNSbvXRj VigzhMl0qNb7MhNNDeN6eTBjpcyq0KuZrZtscqM32j8DJBIePzJIK2dE8gVr2PhxJpElc3jb1tw9M kxCwSLLbsV4S53zKn1f3kFQtah/qsyN+VKi6G+6uzP6+Fhp4NhmWVaVXT/3yrtkjiYPQqgupMcEB9 xtv3VHGnZ8zhioKFBCskzZ283h+dCOC6oqlOuLwsaWY7lEvbTTSuSmsjrRiqVnfSt1Y+cn34f8i3o lTmUojrfgmYUR6QJ2X9YJw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqIh3-0007Pe-Qj; Wed, 02 Nov 2022 14:42:30 -0400 In-Reply-To: <39e03350-2783-fa90-5d66-26e47abe100d@gmail.com> (message from Jim Porter on Wed, 2 Nov 2022 11:17:00 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246888 Archived-At: > Date: Wed, 2 Nov 2022 11:17:00 -0700 > Cc: 58909@debbugs.gnu.org > From: Jim Porter > > > If that's because you want to support the C-g case, then don't: that > > is a separate problem. > > Yeah, this subthread about 'delete-frame' was just to support the C-g > case. Aside from that, I think doing this inside 'server-delete-client' > would be fine. However, at least for this bug, adding a hook that runs > in 'server-delete-client' doesn't add anything that > 'delete-frame-functions' doesn't already allow. ('server-delete-client' > is called from a hook in 'delete-frame-functions' in this case anyway.) We cannot have behavior specific to server.el coded outside of server.el. So I don't think I understand what you are saying here. My suggestion is not to add a hook, it is to add a prompt for the user when the last client frame is deleted, and do it optionally. > > Waaaay too complicated for such a simple problem. Please, let's just > > prompt the user from server-delete-client (and do that under some > > opt-in option), and be done with that. > > If you mean adding a defcustom, I thought we'd agreed not to do that > (see the beginning of your message here[1]). Yes, but you keep pushing... > Would it make sense (possibly in a separate bug) to at least make sure > that the 'server-mode' minor mode is always active when the server is > running? The server.el code sometimes uses 'server-mode' and sometimes > uses 'server-start', with the end result being that the minor mode may > or may not be active depending on the way the server was started. That > seems like a bug all on its own. Maybe it's a bug, but then it's really old. I'm not sure I understand the purpose of this minor mode, and we ourselves start the server in the daemon mode by a direct call to server-start. Also, server-start is a command, and many users (myself included) invoke it interactively. Why is it important to have the mode turned on? What can a mode do that we cannot do without a mode?