On 2012-05-16, John Beckett wrote:
> Bram Moolenaar wrote:
> > If a user switches off 'writebackup' he must be prepared for
> > losing work.  Perhaps this is not sufficiently clear to the
> > user?
> >
> > Considering how very few times this problem occurs I don't
> > think it is justified to do any work on this.  Except perhaps
> > a better explanation in the docs in some place.
> 
> How about twweaking the error message?
> 
> Vim currently shows:
>     "bad.tmp" E513: write error, conversion failed
>       (make 'fenc' empty to override)
>     WARNING: Original file may be lost or damaged don't
>     quit the editor until the file is successfully written!
> 
> I suggest:
>     "bad.tmp" E513: write error, conversion failed
>     WARNING: The file on disk has probably been corrupted.
>     Do not quit until the file is successfully written!
>     Try saving it again after entering (nothing after "="):
>     :set fenc=

That is better.

In this scenario, the user has edited the contents of the file to
his liking and wants to save those contents to disk.  He has also
chosen the file-encoding that he wants.  He doesn't know that the
two are incompatible.  He may not even know that it's possible for
the two to be incompatible.

The error messages above tell the user how to safely save the file
contents.  Neither tell him what the problem is, where the problem
is, or how to get to the desired state of those contents saved with
the desired file-encoding.  That is, after a successful sequence of
":set fenc=", ":w", the user is still left without the desired
file-encoding and no clue as how to change to it.

It would be helpful to the user if the error message included a
statement like, "Character at line 77, column 14 cannot be encoded
with the specified 'fileencoding'."

It that is too much work to implement, then at least ":help E513"
should be more explicit about that particular error, the cause, and
possible solutions.  The error message might even suggest reading
":help E513" since that doesn't seem to occur to some users.

If I have time this evening and no one beats me to it, I'll try to
write up something.

> Or, when writebackup is switched off, issue a clear warning?

That would be really annoying, especially if the user knew what he
was doing and did it often.

Regards,
Gary

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to