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#13522: 24.2; save-buffer removes edited file under some conditions Date: Tue, 15 Mar 2022 16:23:42 +0200 Message-ID: <83tubzi9ap.fsf@gnu.org> References: <87622qaszq.fsf@xvii.vinc17.org> <8735jkye2q.fsf@gnus.org> <83mthsk63c.fsf@gnu.org> <87sfrkwsy5.fsf@gnus.org> <83fsnkk4so.fsf@gnu.org> <87ee33wifm.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36727"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 13522@debbugs.gnu.org, vincent@vinc17.net To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 15 15:24:11 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 1nU85q-0009JP-FR for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 15 Mar 2022 15:24:10 +0100 Original-Received: from localhost ([::1]:48436 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU85p-0006iW-FS for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 15 Mar 2022 10:24:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU85i-0006hY-1r for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2022 10:24:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55370) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU85h-00071g-OF for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2022 10:24:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nU85h-0004KJ-KT for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2022 10:24: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: Tue, 15 Mar 2022 14:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13522 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 13522-submit@debbugs.gnu.org id=B13522.164735424016624 (code B ref 13522); Tue, 15 Mar 2022 14:24:01 +0000 Original-Received: (at 13522) by debbugs.gnu.org; 15 Mar 2022 14:24:00 +0000 Original-Received: from localhost ([127.0.0.1]:49267 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nU85f-0004K2-JO for submit@debbugs.gnu.org; Tue, 15 Mar 2022 10:23:59 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48056) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nU85e-0004Jo-36 for 13522@debbugs.gnu.org; Tue, 15 Mar 2022 10:23:58 -0400 Original-Received: from [2001:470:142:3::e] (port=38760 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU85Y-00070z-IN; Tue, 15 Mar 2022 10:23:52 -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=tAJaTGmt+wAZsbueUm654tWWDOO47Ffa7mIUL5KXfB8=; b=qasi2yk15/xk 37i+rjY+G8BmTH2YaulK33bVEwsbWi+IOa6fq6/kgNhSpR8DivZ7sU/kLGiXGihJSdyrRc5Ja6GPg ifEpSS1A1ryWRhh9LafQAPfNm/KYmRf8HL8pUiTLJXLQKTT13qQpPqzHa0eYMxxBIVw/S2lFaD2et bLKlv/P24eEq9MRKZNY2PDRnL8n+4DfYFjEL9DpZ991cM0DGCg1Z5Mb1aC5f37DX1jwtgEMDTiVN9 sKGjWGzVw4pvQOEJ1CYWOSlfGeooNQZw3iOl0zgQqTxz+DhgucFQIByDdZBQWriZ8RaKI+CevCH+t IiYEM80KwbaIedkY8wFk+w==; Original-Received: from [87.69.77.57] (port=2621 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 1nU85Y-0000Gj-2N; Tue, 15 Mar 2022 10:23:52 -0400 In-Reply-To: <87ee33wifm.fsf@gnus.org> (message from Lars Ingebrigtsen on Tue, 15 Mar 2022 12:42:37 +0100) 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:228407 Archived-At: > From: Lars Ingebrigtsen > Cc: vincent@vinc17.net, 13522@debbugs.gnu.org > Date: Tue, 15 Mar 2022 12:42:37 +0100 > > Eli Zaretskii writes: > > >> And, yes, we make no guarantees, but the present situation doesn't seem > >> optimal. The user may well hit `C-z' at the prompt and wonder where the > >> file disappeared to. > > > > That's in the "if it hurts, don't do that" department, IMO. SIGINT is > > a fatal signal, and our response to fatal signals cannot be too > > fancy. We just auto-save what we can and commit suicide. Even that > > is disliked by some, who say we cannot safely do anything non-trivial > > from a fatal signal handler -- and they are absolutely right, we do > > stuff that invokes undefined behavior. > > I agree that killing Emacs is unusual. But suspending Emacs (with > `C-z') is something people do all the time, and in this case, if the > user is suspending Emacs on this prompt, they might be doing that to > examine the file before saving it, for instance. And then they'll be > confused that it's apparently gone. Does the problem actually happen if you type C-z? Emacs is not dead in that case, just suspended. Type "fg RET", and you are back inside Emacs, and can pick up where you left off. Right? > So I think we should fix this, perhaps the way Glenn suggested in his > patch, but it's obviously not high priority. I'm not against making this particular scenario have a smaller window of opportunity (if the solution is clean), but it will still be possible to cause similar problems by using SIGINT or any other signal during this and other similar procedures that aren't atomic.