"Stephen J. Turnbull" wrote:
>>>>> "Kyle" == Kyle Jones <kyle_jones(a)wonderworks.com>
writes:
Kyle> Ben Wing writes:
>> the idea was that escape-quoted should be used *everywhere*.
>> this is the only way of guaranteeing that auto-save files
>> actually restore exactly what was in the buffer -- or at the
But you can't do what the user wants anyway, since typically the
buffer changes between the autosave and the crash. So it's a question
of how much work does the user have to do to recover the exact state
he was in when he lost the buffer. External utilities as Kyle
mentions below can be very helpful.
>>> very least, we do NOT want to be guessing the encoding of an
>>> auto-save file.
Kyle> I'm not convinced that this is the best approach. MULE is
Kyle> willing to guess the coding system when you first visit a
Kyle> file. I don't see that situation at auto-save recovery time
Kyle> is any different.
But the user may not have accepted the guess the first time. What do
you do then? IIRC recover-file does not take a coding system
argument. We need to do something about that.
Kyle> If you can accurately guess the coding sstem at find-file
Kyle> time, you should be able to guess it at file recovery time.
We can't manage such accuracy. I use C-u C-x C-f a fair amount.
However, you can take a hint from the coding-system that the user
actually used to visit the file. (This is the most common case; I
don't think I've ever invoked recover-file anywhere but from the VM
toolbar). It's nearly certain that that corresponds to the coding
system in force when the buffer was lost, and therefore auto-saving in
the current coding system should do the right thing nearly 100% of the
time.
maybe. however, saving in many coding systems will positively lose data in many
situations. if `binary', all extended chars will be lost. if `iso-2022', many
control chars will be lost. a reasonable thing to implement would be to check
when a file is about to be saved out if data will be lost, and prompt for a
different coding system. beginning users may well get the coding system wrong,
and it's annoying for auto-save to unconditionally lose data.
also, in your scheme we'd have to save the coding system in the auto-save file.