[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] show difference when recovering file
From: |
Stefan Monnier |
Subject: |
Re: [PATCH] show difference when recovering file |
Date: |
Mon, 17 Dec 2012 09:16:15 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
>> There's a problem here: the autosave file is saved using the internal
>> coding-system (so it always succeeds, no matter what weird mix of
>> characters happens to be currently in the buffer), where the
>> non-autosave file will use the encoding which happens to be in use for
>> this file.
> Is it possible to open the non-autosave file in the internal format just
> to run the diff? I guess not.
There's no "open"ing involved: the two files are passed to `diff' and
that's that. So, to fix the problem, we have to load the non-autoload
file, save it using the internal-encoding into a new temporary file, and
then pass this file to diff.
BTW, the "save-to-temp and then diff" is called `diff-buffer-with-file'.
>> So the diff may show lots of spurious changes.
> I think it's a borderline case. It's more useful to see what the
> difference is between the two files even though on rare occasion the
> diff will show garbage
I'd rather do it right.
BTW, the way the user can do it currently, is to say "yes" to recover,
and then use M-x diff-buffer-with-file RET to decide whether or not
recovering is a good idea.
Rather than always popping up a *diff* buffer, we could also change the
prompt from "yes/no" to "yes/no/diff".
Stefan
Re: [PATCH] show difference when recovering file, Juri Linkov, 2012/12/17