From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Don't complain about changed file when it hasn't changed Date: Mon, 29 Aug 2016 17:34:08 +0300 Message-ID: <83oa4bbq5b.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1472481544 10614 195.159.176.226 (29 Aug 2016 14:39:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 29 Aug 2016 14:39:04 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 29 16:38:58 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 1beNiC-00022J-IL for ged-emacs-devel@m.gmane.org; Mon, 29 Aug 2016 16:38:56 +0200 Original-Received: from localhost ([::1]:43894 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1beNiA-0000gh-6P for ged-emacs-devel@m.gmane.org; Mon, 29 Aug 2016 10:38:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1beNdo-0006IV-71 for emacs-devel@gnu.org; Mon, 29 Aug 2016 10:34:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1beNdj-0006ZM-93 for emacs-devel@gnu.org; Mon, 29 Aug 2016 10:34:24 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35851) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1beNdj-0006ZI-5m; Mon, 29 Aug 2016 10:34:19 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4284 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1beNdg-00038D-C1; Mon, 29 Aug 2016 10:34:18 -0400 In-reply-to: (message from Stefan Monnier on Sun, 28 Aug 2016 20:29:42 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:206870 Archived-At: > From: Stefan Monnier > 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.