Bram -
vim can't treat ff and fenc, bin option on modelines. We can specify 'fencs' for judging some encodings. But vim often mis-judge when opening a text file. If we can set 'fenc' on modeline, vim won't fail.

I wrote a patch for this support. Please check and include.
#This patch include support of ff and bin.

I understand the desire to make something like this, but I can't say I
like it.

I don't see much use in setting the 'bin' option in a modeline.  And
certainly not in switching it off.

Same is true for 'fileformat'.  Vim detects this quite reliably.  If
'fileformat' appears in a modeline it's probably a mistake of the user.

For 'fileencoding' it can be useful, since Vim can't always detect the
encoding of the file.  The current patch first loads the whole file,
checks the modelines and then may load the file again.  That's a bit
unexpected.  In readfile() there already is a loop to retry another
fileformat.  I think this is also the place to handle the modeline.
This does require a more complicated patch, but it's worth it.

I think that when "++enc=name" is used the fileencoding value of the
modeline should not be used.

There is a small problem with backwards compatibility: Previously
setting 'fileencoding' in the modeline caused conversion when the file
was written.  Mostly this was a mistake though, and hardly ever useful.

Modelines can be set also at bottom lines. So, it may be difficult to
process modelines in readline() for vim.  I guess that it should be this
place.

If it will not cause an infinite loop, this reload is very useful. The
people who needs this processing method 'fenc' in modelines, don't care
overhead of reading a file few times. and the people who use this
feature are sure to understand it.

A.J.Mechelynck -
Suggestion: Delay this patch until the next point release, so that it can be handled with

        vim701: fenc=latin1

Yes, I think so. :-)
Higher Regards Too.

Thanks.
- Yasuhiro Matsumoto


Reply via email to