From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: Don't complain about changed file when it hasn't changed
Date: Mon, 29 Aug 2016 10:50:04 -0400 [thread overview]
Message-ID: <jwv8tvfbpq6.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: 83oa4bbq5b.fsf@gnu.org
>> 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?
I think a common case nowadays is using Git's checkout and stash where
you might change a file temporarily and then get back to its previous
state (but with a different timestamp).
Another I've bumped into several times is when you "touch <file>" for
purposes such as forcing a re-compilation.
> Is it possible there are some use cases where this should be turned
> off (in which case we might need a user option)?
I couldn't think of any, but I'm not 100% positive that there can't be,
that's why I'm asking for objections here ;-)
> . compare-buffer-substrings is sensitive to case-fold-search value of
> the current buffer, while we want the comparison case-sensitive
Oh, indeed. I missed that it doesn't work like compare-strings. Thanks.
> . 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)
Yes, I noticed that recently (tho I'm not worried about false alarms,
but rather about silently considering that the file hasn't changed
although it has).
> . 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.
> . 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
Sure.
> And, of course, please provide documentation for the feature.
Not sure what there is to document, actually (I do have a NEWS entry for
it, OTOH).
Stefan
next prev parent reply other threads:[~2016-08-29 14:50 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-29 0:29 Don't complain about changed file when it hasn't changed Stefan Monnier
2016-08-29 3:36 ` Clément Pit--Claudel
2016-08-29 3:39 ` Daniel Colascione
2016-08-29 3:43 ` Clément Pit--Claudel
2016-08-29 6:44 ` Michael Albinus
2016-08-29 14:42 ` Eli Zaretskii
2016-08-29 16:18 ` Michael Albinus
2016-08-29 17:42 ` Davis Herring
2016-08-29 17:57 ` Clément Pit--Claudel
2016-08-29 19:10 ` Davis Herring
2016-08-29 13:17 ` Stefan Monnier
2016-08-30 9:20 ` Michael Albinus
2016-08-30 15:00 ` Stefan Monnier
2016-08-30 13:40 ` Clément Pit--Claudel
2016-08-30 15:01 ` Stefan Monnier
2016-08-30 15:23 ` Clément Pit--Claudel
2016-08-30 15:48 ` Stefan Monnier
2016-08-30 16:55 ` Eli Zaretskii
2016-08-30 16:11 ` Eli Zaretskii
2016-08-30 16:38 ` Clément Pit--Claudel
2016-08-29 14:34 ` Eli Zaretskii
2016-08-29 14:50 ` Stefan Monnier [this message]
2016-08-30 15:26 ` Eli Zaretskii
2016-08-30 15:44 ` Stefan Monnier
2016-08-30 16:15 ` Eli Zaretskii
2016-08-30 17:13 ` Stefan Monnier
2016-08-30 17:26 ` Eli Zaretskii
2016-08-30 18:02 ` Stefan Monnier
2016-08-30 15:46 ` Stefan Monnier
2016-08-30 16:19 ` Eli Zaretskii
2016-08-30 17:16 ` Stefan Monnier
2016-08-30 17:32 ` Eli Zaretskii
2016-08-30 18:06 ` Stefan Monnier
2016-09-01 13:49 ` Eli Zaretskii
2016-09-02 15:22 ` Stefan Monnier
2016-09-02 15:26 ` Eli Zaretskii
2016-09-02 15:44 ` Stefan Monnier
2016-09-02 15:39 ` Joost Kremers
2016-08-29 16:01 ` Stefan Monnier
2016-08-29 16:26 ` Eli Zaretskii
2016-08-30 0:35 ` Stefan Monnier
2016-08-29 17:50 ` Davis Herring
2016-08-29 18:09 ` Eli Zaretskii
2016-08-29 19:22 ` Davis Herring
2016-08-30 0:39 ` Stefan Monnier
2016-08-30 7:55 ` Andreas Schwab
2016-08-30 0:37 ` Stefan Monnier
2016-08-30 1:23 ` Rolf Ade
2016-08-30 15:12 ` Eli Zaretskii
2016-08-30 15:34 ` Clément Pit--Claudel
2016-08-30 16:14 ` Eli Zaretskii
2016-09-06 16:29 ` John Wiegley
2016-09-06 17:50 ` Stefan Monnier
2016-09-06 17:52 ` John Wiegley
2016-09-06 19:00 ` Andreas Röhler
2016-09-06 21:00 ` Stefan Monnier
2016-09-06 21:29 ` Drew Adams
2016-09-06 21:41 ` Karl Fogel
2016-09-06 21:59 ` Paul Eggert
2016-09-06 22:01 ` Karl Fogel
2016-09-06 22:07 ` Davis Herring
2016-09-06 22:21 ` Karl Fogel
2016-09-06 22:46 ` Clément Pit--Claudel
2016-09-07 0:24 ` Stefan Monnier
2016-09-07 16:49 ` Karl Fogel
2016-09-07 18:41 ` Andreas Röhler
2016-09-07 20:02 ` Karl Fogel
2016-09-06 22:03 ` Karl Fogel
2016-12-24 1:03 ` Rolf Ade
2016-12-25 15:44 ` Stefan Monnier
2016-12-26 0:29 ` Rolf Ade
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwv8tvfbpq6.fsf-monnier+gmane.emacs.devel@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.