From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?B?6Lev5a6i?= Newsgroups: gmane.emacs.devel Subject: Re: Emacs does not detect a buffered file got deleted Date: Mon, 8 Aug 2016 16:55:55 +0800 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c11436cebcfce05398b9719 X-Trace: blaine.gmane.org 1470646636 32061 195.159.176.226 (8 Aug 2016 08:57:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 8 Aug 2016 08:57:16 +0000 (UTC) Cc: Emacs developers To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 08 10:57:12 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bWgMb-0004pr-Vx for ged-emacs-devel@m.gmane.org; Mon, 08 Aug 2016 10:56:50 +0200 Original-Received: from localhost ([::1]:55700 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWgMY-0007Z8-Kt for ged-emacs-devel@m.gmane.org; Mon, 08 Aug 2016 04:56:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWgMP-0007Xa-Gv for emacs-devel@gnu.org; Mon, 08 Aug 2016 04:56:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bWgMO-000605-HL for emacs-devel@gnu.org; Mon, 08 Aug 2016 04:56:37 -0400 Original-Received: from mail-it0-x234.google.com ([2607:f8b0:4001:c0b::234]:36255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWgMO-000601-AD for emacs-devel@gnu.org; Mon, 08 Aug 2016 04:56:36 -0400 Original-Received: by mail-it0-x234.google.com with SMTP id x130so68864853ite.1 for ; Mon, 08 Aug 2016 01:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=O3pYH8sy5UdLYiVPdLB9wWNczqj1cW7D9H3XauRcPgU=; b=LmNLlV/soUcH1ny0cHExMIJY9srYbq/r/FU7JgREu2kfzaKPX5cV1wTnrl/hBo6pzp HZK97UvDejeS6+/QdfHpT2j70gsBjN3Ah1OARaA/KgDWHUzsoNFWgjW5I9JKbQWwedv6 r8mUbGzo/Owlk+FHK8FhSjeTdTJmtN7LT14KVaSr5f7b35SwzHYQbq61p9VyhoyXU9D7 1WnHY3c8ZRYUafFqFfW3S733FFyexfBHzNEzNt+mHiw9hhBn12xU+9t7uymN6HgY7LGN SAZahciwjB1JNw1MGcTIdO+JVPCv200PXMfs48+adbk00zH72zPJ4KLlUuNP5gJtjbMr GQxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=O3pYH8sy5UdLYiVPdLB9wWNczqj1cW7D9H3XauRcPgU=; b=hi1O4hesQAGh0tReaPWr8jraVwG6bEzGUIxLQRhESetdOiqxU8HLDOh4hk5mothXeT 91v5F2RzWR5x8pgXcDaXNcvAnAQEMqfamtN8vE15FUsbHo3sxtg11VupfvM+J96EWmRQ lu0NqxtVyW8iSUDbXZdt0hfYyc2/cLB7EN4WNDdjhLfAQb7+w2kNaGIKnwVD2/2vsKDX DoP983M0tCdmJfFy53itLfDI+6Oz3WgmEIxDytL7tDPX4T4jxbqelrz6qESKe3IGCcoj vO7lnLhZWnA2NJ6QePPoVXCMEnbogBrzxxzfD6AogbElqYdgrY6frVtTOqOooV5AnkDB Is5w== X-Gm-Message-State: AEkoouuRjL1BthSCngbtxeDjJwn4kX+Zxs/Ix5teXt3Sgv2RshnEBtryP7pN4jxPUEoHaV/LkzNrWretUAtfpw== X-Received: by 10.36.184.133 with SMTP id m127mr17085114ite.90.1470646595602; Mon, 08 Aug 2016 01:56:35 -0700 (PDT) Original-Received: by 10.107.2.76 with HTTP; Mon, 8 Aug 2016 01:55:55 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4001:c0b::234 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:206478 Archived-At: --94eb2c11436cebcfce05398b9719 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Yes, I understood that. My intention is to notify the user about the deletion but not really want to revert the file. Emacs provide other options other than reverting. A "revert" here might mean "close this buffer". However,this might need further modification to notify the user about the deletion instead of the normal modification notification. Using the original `ask-user-about-supersession-threat' might be a bit confusing if file is deleted. What do you think? 2016-08-08 16:02 GMT+08:00 Andreas Schwab : > On Mo, Aug 08 2016, =E8=B7=AF=E5=AE=A2 wrote: > > > When editing a file in Emacs and switching git branches, sometimes > > a file will be removed but Emacs won't detect it. Unlike modified > > files it will ask me to revert, deleted files are not. Is it > > intentional? > > There is nothing to revert from. A buffer visiting a non-existing file > isn't an error condition, saving it will not lose anything. > > Andreas. > > -- > Andreas Schwab, SUSE Labs, schwab@suse.de > GPG Key fingerprint =3D 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D= 7 > "And now for something completely different." > --=20 Best regards, Luke Lee --94eb2c11436cebcfce05398b9719 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Yes, I understood that. My intention is to notify the= user about the deletion but not
really want to revert the file. Emacs = provide other options other than reverting. A
"revert" here m= ight mean "close this buffer". However,this might need further modification to notify the user about the deletion instead of the normal = modification
notification. Using the original `ask-user-about-supersessi= on-threat' might be a bit
confusing if file is deleted. W= hat do you think?

=C2=A0


2016-08-08 16:02 GM= T+08:00 Andreas Schwab <schwab@suse.de>:
On Mo, Aug 08 2016, =E8=B7=AF=E5=AE=A2 <<= a href=3D"mailto:luke.yx.lee@gmail.com">luke.yx.lee@gmail.com> wrote= :

> When editing a file in Emacs and switching git branches, sometimes
> a file will be removed but Emacs won't detect it. Unlike modified<= br> > files it will ask me to revert, deleted files are not. Is it
> intentional?

There is nothing to revert from.=C2=A0 A buffer visiting a non-exist= ing file
isn't an error condition, saving it will not lose anything.

Andreas.

--
Andreas Schwab, SUSE Labs, schwab@suse.de=
GPG Key fingerprint =3D 0196 BAD8 1CE9 1970 F4BE=C2=A0 1748 E4D4 88E3 0EEA = B9D7
"And now for something completely different."



--
Best regards,
= Luke Lee

--94eb2c11436cebcfce05398b9719--