Subject: bug#19029: Cut down on useless "really edit the buffer?" prompts

From: Paul Pogonyshev <[email-masked]>
Date: Wed, 12 Nov 2014 15:38:23 +0100

When switching between different branches in a VCS system, file
modification date may change even though its contents isn't. For example,
when switching from trunk to a branch X where the file is modified, then
switching back.

As a result, if the file was opened in Emacs before the switches, and I
attempt to edit it afterwards, Emacs prompts me with "... changed on disk;
really edit the buffer?" even though the only thing that "changed" about it
is the modification time. (To make it worse, Emacs requires _three_
confirmation to edit and save...)

Request: if Emacs detects timestamp change, let it read the file and
compare it with the buffer; if they are byte-to-byte identical, just ignore
the timestamp.

To reproduce: open any existing file, say 'x.txt'. Now type:

    M-! touch x.txt

and try to edit the buffer.

Paul