On 2013-06-06, Ken Takata wrote:
> Hi Charles,
> 
> 2013/06/01 Sat 15:25:15 UTC+9 Dominique Pelle wrote:
> > Ken Takata <[email protected]> wrote:
> > 
> > > Hi Charles,
> > >
> > > After updating Vim to 7.3.919 or later, I can't open *.ja including
> > > README.ja (a README file written in Japanese).
> > > When I try to open *.ja, I get the following message:
> > >
> > >   ***error*** (zip#Browse) unzip not available on your system
> > >
> > > (I haven't installed unzip command on my Windows system.)
> > > I'm annoyed by this behavior.
> > >
> > > The file name *.ja is sometime used for Japanese text,
> > > because "ja" is defined as Japanese language code by ISO 639-1.
> > > E.g. Ruby's source code: https://github.com/ruby/ruby
> > >
> > > Please consider adding a way to open *.ja as a plain text
> > > even if unzip isn't available. I think one of the following will do:
> > >
> > > 1. Remove "*.ja" from runtime/plugin/zipPlugin.vim.
> > > 2. Add a setting for which file should be handled by zipPlugin.
> > > 3. Open *.ja as a plain text and do not display the error,
> > >    if unzip isn't available.
> > 
> > Another possibility would be to check the magic number
> > at the start of the file.  A ZIP file must begin with "PK".
> 
> I wrote a patch for this problem using the method 3.
> I'm not sure this is the best solution.

It's not.  The availability of unzip has absolutely nothing to do
with the filetype of a .ja file.

Dominique's suggestion is the best so far.  The test could be as
simple as this:

    readfile(filename, "", 1)[0]=~"^PK"

Regards,
Gary

-- 
-- 
You received this message from the "vim_dev" 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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui