emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Don't complain about changed file when it hasn't changed


From: Eli Zaretskii
Subject: Re: Don't complain about changed file when it hasn't changed
Date: Mon, 29 Aug 2016 17:34:08 +0300

> From: Stefan Monnier <address@hidden>
> Date: Sun, 28 Aug 2016 20:29:42 -0400
> 
> The patch below is supposed to change Emacs such that if the file's
> timestamp has changed, but the contents is still the same, it doesn't
> prompt the user about a supersession-threat.

Thanks.  Can you describe the use case(s) where this is important?  Is
it possible there are some use cases where this should be turned off
(in which case we might need a user option)?

Anyway, the proposed implementation misses a few subtleties, IMO:

 . compare-buffer-substrings is sensitive to case-fold-search value of
   the current buffer, while we want the comparison case-sensitive
 . need to bind coding-system-for-read to the encoding of the file's
   buffer, otherwise you could get spurious false alarms, e.g. if the
   file being checked was visited with non-default decoding (C-x RET c)
 . the file's buffer could be unibyte, in which case you want
   insert-file-contents-literally, I think
 . insert-file-contents could run out of memory, or hit some other
   error, so I think you should catch any errors and consider the
   check failed in that case

And, of course, please provide documentation for the feature.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]