From: 路客 <luke.yx.lee@gmail.com>
To: Emacs developers <emacs-devel@gnu.org>
Subject: Emacs does not detect a buffered file got deleted
Date: Mon, 8 Aug 2016 11:33:26 +0800 [thread overview]
Message-ID: <CAA=xLRMGusqr7jz8rWT3SKEET8F-cgwj+K3Ouc6AZ9vDmNHmmg@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1101 bytes --]
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
[-- Attachment #2: Type: text/html, Size: 1470 bytes --]
next reply other threads:[~2016-08-08 3:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-08 3:33 路客 [this message]
2016-08-08 8:02 ` Emacs does not detect a buffered file got deleted Andreas Schwab
2016-08-08 8:55 ` 路客
2016-08-08 14:55 ` Eli Zaretskii
2016-08-09 1:02 ` 路客
2016-08-10 0:52 ` Jiege Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAA=xLRMGusqr7jz8rWT3SKEET8F-cgwj+K3Ouc6AZ9vDmNHmmg@mail.gmail.com' \
--to=luke.yx.lee@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.