Patch: plugin/gzip.vim, maintain compression levels
Bram Moolenaar
Bram@moolenaar.net
Thu, 19 May 2005 11:02:32 +0200
James -
> > I'm afraid I have given you a wrong hint. When appending the compressed
> > file is not in a buffer, thus then it doesn't work. And that's when it
> > would be most useful.
> >
> > For Vim 7 we can use the readfile() function. I don't know a simple,
> > portable solution for Vim 6.3.
>
> For Vim 6.3, are you going to include this functionality just when
> writing or not at all?
I'm including new features in Vim 7 only. 6.3 is the stable version,
only bug fixes.
> > There would be an error when using ":w file.gz", b:compression would not
> > be set. It's easy to add a check for that:
>
> I specifically set b:compression to "" at the beginning of
> set_compression to avoid that problem. It worked fine with my tests,
> but your approach is cleaner and more obvious.
I thought of allowing the user to specify the argument. Although it
must be reset when reading a file, otherwise it could come from another
file perhaps.
I haven't looked at the file format spec, but it's strange that only
maximum and minimum compression are stored.
- Bram
--
BEDEVERE: How do you know so much about swallows?
ARTHUR: Well you have to know these things when you're a king, you know.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ Project leader for A-A-P -- http://www.A-A-P.org ///
\\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///