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: Emacs does not detect a buffered file got deleted Date: Mon, 8 Aug 2016 11:33:26 +0800 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113fb33aa49512053987160f X-Trace: blaine.gmane.org 1470627342 9792 195.159.176.226 (8 Aug 2016 03:35:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 8 Aug 2016 03:35:42 +0000 (UTC) To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 08 05:35:39 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 1bWbLg-00010f-FE for ged-emacs-devel@m.gmane.org; Mon, 08 Aug 2016 05:35:32 +0200 Original-Received: from localhost ([::1]:54712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWbLd-0000wm-86 for ged-emacs-devel@m.gmane.org; Sun, 07 Aug 2016 23:35:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWbKM-0000Wz-2g for emacs-devel@gnu.org; Sun, 07 Aug 2016 23:34:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bWbKK-0003Un-3C for emacs-devel@gnu.org; Sun, 07 Aug 2016 23:34:09 -0400 Original-Received: from mail-io0-x229.google.com ([2607:f8b0:4001:c06::229]:34401) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWbKJ-0003UY-TV for emacs-devel@gnu.org; Sun, 07 Aug 2016 23:34:08 -0400 Original-Received: by mail-io0-x229.google.com with SMTP id q83so347648460iod.1 for ; Sun, 07 Aug 2016 20:34:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=wU9xoCuaMKr8SZOZ8YEZlL3x7ByDpvRy3s4pER6ClZg=; b=jb9wGh6F5rCkuPXb4U6pxZOFKIV/PZ9VQ6WS55cVuywkiJ+UO6N8dHv/l26hft2lLG 71o5Dgm10+IeUs9r8+0vEpowN3RQW0wuU+TTqYmQwJgh3gtgH7Ij+nJf251eOJtbo1x8 HsP0V5M25dVDJlBQigARQe91Qqd0Uq10v1YxUc2oK/fgYNok+K24LmbUtOZ+5YTxk4LI ZyOhcySox7vhq44LB80liw9VfRG0j5i0B7mkub6CInRwdmxRmJ0Gm0GTbmkMsFgdgGtj bJcCIt7Af9TAWAHt04m8jm2mJUgSBE+vtMQBYtNyNq8GHBpKo3EH7qiyVo1hNWORtV3k t4Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=wU9xoCuaMKr8SZOZ8YEZlL3x7ByDpvRy3s4pER6ClZg=; b=TVO0ixV0tFvyvj7pCHYPElSPwRxxtl4+WmuPpLuq2j7R5nU58EyOf+Y1F7EYpe53rc 6oXUTtP2nucovS0h7UnDju2GD2w8yKWzGLnnFhaYQrudLs8KU7g9qYhI2KpQ1QqZ/Yrs aE3SHIu9dDrvezHbwdWkgCru9+vU75IAUeaPjhwAwfhHzB3okCqsfIyBR+mDiUhObaPm L5dvK8K0yOdLN4kvLeTLx0IBw3sTlgxODNP6Q69gBSd6JfZMMswzMkMj7+LNzL7zRAZ1 qEufGktItdgsF/zimxmDHT5W4A2qzSU7Al7/2VyeZD2cDWXCvBjr4C7OwZwWPnKW6Qq3 DYzw== X-Gm-Message-State: AEkooutOBCEVLmkQyvcf+ha9ci4ScZfr2AtQd4LMPVGPSesdIfdvkialzTt1NDUP6HvnbWmqhU5HW7dVrHsHKg== X-Received: by 10.107.14.4 with SMTP id 4mr92607665ioo.160.1470627246800; Sun, 07 Aug 2016 20:34:06 -0700 (PDT) Original-Received: by 10.107.2.76 with HTTP; Sun, 7 Aug 2016 20:33:26 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4001:c06::229 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:206474 Archived-At: --001a113fb33aa49512053987160f Content-Type: text/plain; charset=UTF-8 Hi all: 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? After a while I found this behavior exists from the very beginning trace back to 1991-01-14 RMS's original code in filelock.c, function "lockfile": { register Lisp_Object subject_buf = Fget_file_buffer (fn); if (!NULL (subject_buf) && NULL (Fverify_visited_file_modtime (subject_buf)) && !NULL (Ffile_exists_p (fn))) /// <<<<<< HERE <<<<<<<<< call1 (intern ("ask-user-about-supersession-threat"), fn); } It then later changed by Jim Blandy on 1992-01-13 to change "NULL" to "NILP": if (!NILP (subject_buf) && NILP (Fverify_visited_file_modtime (subject_buf)) && !NILP (Ffile_exists_p (fn))) /// <<<<<<< HERE <<<<<<<<< call1 (intern ("ask-user-about-supersession-threat"), fn); Should we now consider remove the last condition "&& !NILP (Ffile_exists_p (fn))" to make Emacs able to detect file deletion? Thanks. -- Best regards, Luke Lee --001a113fb33aa49512053987160f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi all:

When editing a file in Emacs and switching = git branches, sometimes
a file will be removed but Emacs won't detec= t it. Unlike modified
files it will ask me to revert, deleted files are= not. Is it
intentional? After a while I found this behavior exists fro= m the very
beginning trace back to 1991-01-14 RMS's original code i= n filelock.c,
function "lockfile":

{
=C2=A0 register= Lisp_Object subject_buf =3D Fget_file_buffer (fn);
=C2=A0 if (!NULL (su= bject_buf)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 && NULL (Fverify_visit= ed_file_modtime (subject_buf))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &&= !NULL (Ffile_exists_p (fn))) /// <<<<<< HERE <<<= ;<<<<<<
=C2=A0=C2=A0=C2=A0 call1 (intern ("ask-us= er-about-supersession-threat"), fn);
}

It then later changed= by Jim Blandy on 1992-01-13 to change "NULL"
to "NILP&qu= ot;:

=C2=A0 if (!NILP (subject_buf)
=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 && NILP (Fverify_visited_file_modtime (subject_buf))
=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 && !NILP (Ffile_exists_p (fn)))=C2=A0 /// = <<<<<<< HERE <<<<<<<<<
= =C2=A0=C2=A0=C2=A0 call1 (intern ("ask-user-about-supersession-threat&= quot;), fn);


Should we now consider remove the last condition"&& !NILP (Ffile_exists_p (fn))"
to make Emacs able t= o detect file deletion?

Thanks.


--
Best regards,
L= uke Lee

--001a113fb33aa49512053987160f--