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#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files Date: Fri, 21 Oct 2022 09:38:19 +0300 Message-ID: <83h6zxwujo.fsf@gnu.org> References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> <83lepoi58p.fsf@gnu.org> <83y1tbxbbt.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31773"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 21 08:48:02 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 1ollp2-0007r6-GH for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 21 Oct 2022 08:48:00 +0200 Original-Received: from localhost ([::1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ollp1-0004ca-7O for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 21 Oct 2022 02:47:59 -0400 Original-Received: from [::1] (helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ollgj-0000pt-OG for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 21 Oct 2022 02:39:25 -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 1ollgN-0000hJ-MU for bug-gnu-emacs@gnu.org; Fri, 21 Oct 2022 02:39:11 -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 1ollgM-0002WE-W7 for bug-gnu-emacs@gnu.org; Fri, 21 Oct 2022 02:39:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ollgM-0004Ko-Iu for bug-gnu-emacs@gnu.org; Fri, 21 Oct 2022 02:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Oct 2022 06:39: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.166633431116625 (code B ref 51993); Fri, 21 Oct 2022 06:39:02 +0000 Original-Received: (at 51993) by debbugs.gnu.org; 21 Oct 2022 06:38:31 +0000 Original-Received: from localhost ([127.0.0.1]:36716 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ollfq-0004K3-UZ for submit@debbugs.gnu.org; Fri, 21 Oct 2022 02:38:31 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53848) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ollfn-0004Jp-EU for 51993@debbugs.gnu.org; Fri, 21 Oct 2022 02:38:28 -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 1ollfi-0001Aj-0P; Fri, 21 Oct 2022 02:38:22 -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=yPQbv0TJMRc5R1dzQcvHSCZQGMYgd0oAYYZEGzcpszM=; b=Zw4sSdOm4ZvO gAzYv6iAcGZaUizKXKM8twyBVSzJAmy+mWbnhbvWmQ7e2PG/GNDBTlUCp+bjtoRSDDOwVSk6Vp+YG 4fd3wx9jSdqNd8OCq7voPf4IdzeQ2gE1fPB9/dMusnBFHhMeIK/mSWcq3g+xNjwrCxq2jvwuCCKsB 7mZhUdFMVzdcYZlUQ67Uk4WNJ29RWPYOuGvQOnlikVhiQ21NkilJaXEdwNqYdj5/zdFkDfAdhIB8A 9UU7TOEx1f4vJQqUUDlslRUaEutOTNNqcSTG4KYgwgMgl1iNimWSUNX/fcv9JNNa/ND8VQx7UsJcq rlfOblSOVLB6DXFl+YcnhQ==; 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 1ollfh-0007CL-FN; Fri, 21 Oct 2022 02:38:21 -0400 In-Reply-To: (message from Jim Porter on Thu, 20 Oct 2022 22:51:42 -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: , 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:245963 Archived-At: > Date: Thu, 20 Oct 2022 22:51:42 -0700 > Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org > From: Jim Porter > > >> b) if this *is* the last client, prompt the user to save everything > >> (as with 'save-buffers-kill-emacs'), and then delete the client + kill > >> the Emacs daemon. > > > > You mean, in b), instead of just deleting the frame and leaving the > > daemon run, you want to shut down Emacs in its entirety, as if the > > user invoked kill-emacs? I'm okay with that as an optional behavior, > > although I myself won't use it, as it's too dangerous. > > Almost. I'd like it to be as if the user invoked > 'save-buffers-kill-emacs'; that is, before killing Emacs, prompt the > user about everything[1] that might be lost by killing Emacs. That should already happen, if you just call save-buffers-kill-emacs in that case, right? > This already exists as an option -- (server-stop-automatically > 'delete-frame)[2], but I also find the current behavior too dangerous. > My original message outlines one of the problems with the current > implementation: it changes the behavior of (a) in my description above. > > > $ emacs -Q --daemon > > $ emacsclient -a "" -c foo.txt > > $ emacsclient -a "" -c bar.txt > > > > ;; In the first client frame: > > foobar ;; Insert some text > > C-x C-c > > ;; Emacs prompts "Save file /path/to/foo.txt?..." > > > > Now try the above, but call `(server-stop-automatically 'delete-frame)' first (or replace `delete-frame' with `kill-terminal'; it doesn't matter). In this case, Emacs doesn't prompt to save the file. I'm not sure I see the direct relevance, and I don't think I see a bug in the above behavior. I'm probably missing something, but what?