Yasuhiro Matsumoto wrote: > 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. -- >From the classified section of a city newspaper: Dog for sale: eats anything and is fond of children. /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ download, build and distribute -- http://www.A-A-P.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///