From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files Date: Tue, 23 Nov 2021 22:49:49 +0000 Message-ID: <890d44ded2c42fe531a1@heytings.org> References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <83pmqvti49.fsf@gnu.org> <890d44ded2b56811ceff@heytings.org> <64c7eb70-d941-9c98-4513-a2bdc44e7953@gmail.com> <890d44ded2fa8ff77ab2@heytings.org> <1623621b-d2a6-a68c-ac28-cdd371886b11@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40286"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 51993@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 23 23:50:35 2021 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 1mpecV-000AIn-FF for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 23 Nov 2021 23:50:35 +0100 Original-Received: from localhost ([::1]:34086 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mpecT-0004cW-Si for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 23 Nov 2021 17:50:33 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpeby-0004c7-Jv for bug-gnu-emacs@gnu.org; Tue, 23 Nov 2021 17:50:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40895) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mpeby-0003lu-B3 for bug-gnu-emacs@gnu.org; Tue, 23 Nov 2021 17:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mpeby-0000Uv-6D for bug-gnu-emacs@gnu.org; Tue, 23 Nov 2021 17:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Nov 2021 22:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51993 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 51993-submit@debbugs.gnu.org id=B51993.16377077971896 (code B ref 51993); Tue, 23 Nov 2021 22:50:02 +0000 Original-Received: (at 51993) by debbugs.gnu.org; 23 Nov 2021 22:49:57 +0000 Original-Received: from localhost ([127.0.0.1]:52441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpebs-0000UW-OT for submit@debbugs.gnu.org; Tue, 23 Nov 2021 17:49:57 -0500 Original-Received: from heytings.org ([95.142.160.155]:46530) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpebn-0000UE-8z for 51993@debbugs.gnu.org; Tue, 23 Nov 2021 17:49:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1637707789; bh=Je/vPRoE019wI1Py0bF3po4+WZIr+AhRe6TFd8MyoG0=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=wTl81R51BjkuqTFbWDCgPI5WILNXUSBYf+t8jr3QrKMzk4pa+YtgnH9kT3YztkijW Xv/pt7N21xkyTaUIZZnp+zPA2nSiebo519kTobj6pZ/fiUvCZb9fO/94ZWfeqP92/0 AxjJZcevV8M7jKuc9a+4CopcKEID3UGGL38TFFqirxalv8rXg2BllcuP62iF8m/hlu GuJwgC9+r6eQIkse/AzhQ7GzFuDKllIRKENWSAIdPE6Vag31sWAuWlTu1sKpdwwt+V c6WG1ErFG/YN1ZqsB3KC/f1MIeHGASz+opfXh+monnivzlRMgyde4n09ppr46FpNTe aoGlbcXD7UOXA== In-Reply-To: <1623621b-d2a6-a68c-ac28-cdd371886b11@gmail.com> 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:220691 Archived-At: >>> I should stress that the case I brought up above is just a >>> counterexample to show a problem with a previous implementation >>> strategy >> >> Which problem? > > Prior to that comment, your proposed implementation would kill Emacs on > a timer when there were no non-daemon frames left, which could result in > unsaved changes to files being lost. I replied to point that out and > showed some steps to reproduce it: > . > I don't think it's useful to discuss a problem that was raised and fixed a month ago. > > If I'm understanding your patch, the behavior I'm looking for is > essentially a combination of `kill-terminal' and `delete-last-frame'. > If so, a fifth behavior could be implemented. But you would have to describe what you want, and it should be something reasonable. Could you please do that, and explain what you want when: 1. You delete a frame that is not the last one 2. You delete the last frame 3. You kill a terminal that is not the last one 4. You kill a terminal that is the last one > > I've specified the problems. I can try to clarify if there's any > confusion though. This bug is one such problem. > As I said earlier, the problem you described in this bug report was not a bug, at least in the sense that it was not something that was not explicitly intended by the one who wrote the code (and documented). And the behavior you wanted is handled by the patch I sent, without removing any of the other existing behaviors. But now you apparently want something else again. > > I don't think that a user who opts in to stopping the Emacs daemon > automatically is *also* opting in to changing the behavior of whether > Emacs will prompt about saving files when killing a (non-last) client. > Since there are other clients, the daemon won't be killed, and so the > behavior should be identical to what happens without > `server-stop-automatically'. As a user, I would find it very strange > that enabling `server-stop-automatically' would change Emacs' behavior > in ways *other than* stopping the server in certain cases. > Yet this is what you're asking. If you want Emacs to prompt you whether the files should be saved and the process killed when you delete the last frame, you want to change the way Emacs prompts about saving files and killing processes, because this (namely prompting the user when the last frame is deleted) isn't happening without server-stop-automatically.