From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Don't complain about changed file when it hasn't changed Date: Tue, 06 Sep 2016 20:24:07 -0400 Message-ID: References: <87oa40k8oq.fsf@red-bean.com> <87fupck7s2.fsf@red-bean.com> <73a01198-e334-2424-7143-8882092ffb78@lanl.gov> <874m5sk6tr.fsf@red-bean.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1473207692 24949 195.159.176.226 (7 Sep 2016 00:21:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 7 Sep 2016 00:21:32 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cc: Paul Eggert , emacs-devel@gnu.org To: Karl Fogel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 07 02:21:27 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 1bhQcA-0004qn-Dc for ged-emacs-devel@m.gmane.org; Wed, 07 Sep 2016 02:21:18 +0200 Original-Received: from localhost ([::1]:36894 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhQc7-0006i4-5V for ged-emacs-devel@m.gmane.org; Tue, 06 Sep 2016 20:21:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhQc1-0006hx-0p for emacs-devel@gnu.org; Tue, 06 Sep 2016 20:21:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhQbw-0006s7-Sd for emacs-devel@gnu.org; Tue, 06 Sep 2016 20:21:07 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:52294) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhQbw-0006s1-NV for emacs-devel@gnu.org; Tue, 06 Sep 2016 20:21:04 -0400 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id u870LcPU032283; Tue, 6 Sep 2016 20:21:38 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 6E1C066340; Tue, 6 Sep 2016 20:24:07 -0400 (EDT) In-Reply-To: <874m5sk6tr.fsf@red-bean.com> (Karl Fogel's message of "Tue, 06 Sep 2016 17:21:36 -0500") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5789=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5789> : inlines <5189> : streams <1696442> : uri <2283583> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 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:207235 Archived-At: >> You just remember the file's size as well as its modtime when visiting >> it -- don't compare to the buffer's size at all. (I thought I had >> mentioned this earlier in the thread...) > Oh -- remember the "true" size (that is, the > unencrypted/uncompressed/unwhatevered) size of the file at the moment when > it is first visited? Yes, that's what my FIXME comment was referring to. Comparing the buffer's size and the file's size would miss too many case and would be too brittle for my taste (there are many different ways to modify the data on the way between the file and the buffer). > As long as we're doing that, why not just remember the md5sum of the > original content too? Cause it'd slow down a common case, compared to this ask-user-about-supersession-threat which is used very rarely? Stefan