all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs does not detect a buffered file got deleted
@ 2016-08-08  3:33 路客
  2016-08-08  8:02 ` Andreas Schwab
  0 siblings, 1 reply; 6+ messages in thread
From: 路客 @ 2016-08-08  3:33 UTC (permalink / raw)
  To: Emacs developers

[-- 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 --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-08-10  0:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-08  3:33 Emacs does not detect a buffered file got deleted 路客
2016-08-08  8:02 ` 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

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.