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, 30 Aug 2016 13:13:14 -0400 Message-ID: References: <83oa4bbq5b.fsf@gnu.org> <83a8funuqw.fsf@gnu.org> <83vayimdvu.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1472577075 25257 195.159.176.226 (30 Aug 2016 17:11:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 30 Aug 2016 17:11:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 30 19:11:09 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 1bemZ2-0005tq-65 for ged-emacs-devel@m.gmane.org; Tue, 30 Aug 2016 19:11:08 +0200 Original-Received: from localhost ([::1]:50285 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bemYz-0008PZ-ON for ged-emacs-devel@m.gmane.org; Tue, 30 Aug 2016 13:11:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bemYD-0008Nx-9z for emacs-devel@gnu.org; Tue, 30 Aug 2016 13:10:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bemY9-0005hi-1x for emacs-devel@gnu.org; Tue, 30 Aug 2016 13:10:16 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:59274) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bemY8-0005hP-TK; Tue, 30 Aug 2016 13:10:12 -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 u7UHAorc019126; Tue, 30 Aug 2016 13:10:51 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 4EABE66274; Tue, 30 Aug 2016 13:13:14 -0400 (EDT) In-Reply-To: <83vayimdvu.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 30 Aug 2016 19:15:49 +0300") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5782=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5782> : inlines <5157> : streams <1692549> : uri <2278170> 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:206969 Archived-At: >> >> > . the file's buffer could be unibyte, in which case you want >> >> > insert-file-contents-literally, I think >> >> We could try to be more careful in this way, indeed. But AFAIK the only >> >> risk here is to flag a file as being changed when it hasn't, which is no >> >> worse than what we currently do (i.e. a false alarm), so I'm not sure >> >> it's worth the trouble. >> > The documentation should state this exemption, lest users expect >> > unibyte buffers to get the same treatment. >> I don't know for a fact that it doesn't work in the unibyte case, actually. > buffer-file-coding-system will be the local default, How do you know? IOW, which scenario are you thinking about? I tried find-file on a PDF file and find-file-literally on a non-ascii text file and in both cases I get a buffer with buffer-file-coding-system set to `no-conversion'. And indeed, in my tests, the code I sent just correctly detects that the file was not changed. > so a non-ASCII file will be decoded. Maybe in some cases it may not work, indeed. My favorite way to fix those would be to make sure buffer-file-coding-system is set to something like `binary' when the buffer is unibyte. Stefan