r213 - in trunk/vim/debian: . patches
James Vega
jamessan-guest@costa.debian.org
Thu, 19 May 2005 13:44:23 +0000
Author: jamessan-guest
Date: 2005-05-19 13:44:22 +0000 (Thu, 19 May 2005)
New Revision: 213
Modified:
trunk/vim/debian/changelog
trunk/vim/debian/patches/125_gzip.vim.diff
Log:
Updated patch to Bram's final version.
Modified: trunk/vim/debian/changelog
===================================================================
--- trunk/vim/debian/changelog 2005-05-19 07:28:07 UTC (rev 212)
+++ trunk/vim/debian/changelog 2005-05-19 13:44:22 UTC (rev 213)
@@ -1,10 +1,11 @@
vim (1:6.3-071+3) unstable; urgency=low
* James Vega <jamessan@jamessan.com>
- + Updated patch 125_gzip.vim.diff so that compression detection is
- performed using Vim instead of external tools.
+ + Updated patch 125_gzip.vim.diff to match upstream's vim7 patch.
+ Removed compression detection for FileAppendPre since there's no good
+ way to retrieve the necessary information.
- -- Debian VIM Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> Wed, 18 May 2005 13:31:23 -0400
+ -- Debian VIM Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> Thu, 19 May 2005 09:09:05 -0400
vim (1:6.3-071+2) unstable; urgency=low
Modified: trunk/vim/debian/patches/125_gzip.vim.diff
===================================================================
--- trunk/vim/debian/patches/125_gzip.vim.diff 2005-05-19 07:28:07 UTC (rev 212)
+++ trunk/vim/debian/patches/125_gzip.vim.diff 2005-05-19 13:44:22 UTC (rev 213)
@@ -1,60 +1,71 @@
-diff -ur vim63.orig/runtime/plugin/gzip.vim vim63/runtime/plugin/gzip.vim
---- vim63.orig/runtime/plugin/gzip.vim 2005-05-18 13:15:05.000000000 -0400
-+++ vim63/runtime/plugin/gzip.vim 2005-05-18 13:21:01.000000000 -0400
-@@ -48,12 +48,39 @@
+--- vim63.orig/runtime/plugin/gzip.vim 2005-05-19 08:50:56.000000000 -0400
++++ vim63/runtime/plugin/gzip.vim 2005-05-19 08:41:03.000000000 -0400
+@@ -48,12 +48,41 @@
exe "return s:have_" . name
endfun
-+" Set a buffer local variable which contains the compression method used when
-+" this file was compressed. This can then be used later when we recompress
-+" the file in s:write(). This only matters if we're using gzip. The only
-+" compression methods that can be detected are max speed (-1) and max
++" Set b:gzip_comp_arg to the gzip argument to be used for compression, based on
++" the flags in the compressed file.
++" The only compression methods that can be detected are max speed (-1) and max
+" compression (-9).
-+fun s:set_compression()
-+ let b:compression = ""
-+ if !s:have_gzip
-+ return
-+ endif
++fun s:set_compression(line)
+ " get the Compression Method
-+ let l:cm = char2nr(getline('1')[2])
++ let l:cm = char2nr(a:line[2])
+ " if it's 8 (DEFLATE), we can check for the compression level
+ if l:cm == 8
+ " get the eXtra FLags
-+ let l:xfl = char2nr(getline('1')[8])
++ let l:xfl = char2nr(a:line[8])
+ " max compression
+ if l:xfl == 2
-+ let b:compression = "-9"
++ let b:gzip_comp_arg = "-9"
+ " min compression
+ elseif l:xfl == 4
-+ let b:compression = "-1"
++ let b:gzip_comp_arg = "-1"
+ endif
+ endif
+endfun
+
++
" After reading compressed file: Uncompress text in buffer with "cmd"
fun s:read(cmd)
" don't do anything if the cmd is not supported
if !s:check(a:cmd)
return
endif
-+ call s:set_compression()
++
++ " for gzip check current compression level and set b:gzip_comp_arg.
++ silent! unlet b:gzip_comp_arg
++ if a:cmd[0] == 'g'
++ call s:set_compression(getline(1))
++ endif
++
" make 'patchmode' empty, we don't want a copy of the written file
let pm_save = &pm
set pm=
-@@ -116,7 +143,7 @@
+@@ -116,7 +145,11 @@
let nm = resolve(expand("<afile>"))
let nmt = s:tempname(nm)
if rename(nm, nmt) == 0
- call system(a:cmd . " " . nmt)
-+ call system(a:cmd . " " . b:compression . " " . nmt)
++ if exists("b:gzip_comp_arg")
++ call system(a:cmd . " " . b:gzip_comp_arg . " " . nmt)
++ else
++ call system(a:cmd . " " . nmt)
++ endif
call rename(nmt . "." . expand("<afile>:e"), nm)
endif
endif
-@@ -126,6 +153,7 @@
+@@ -126,8 +159,12 @@
fun s:appre(cmd)
" don't do anything if the cmd is not supported
if s:check(a:cmd)
-+ call s:set_compression()
- " Rename to a weird name to avoid the risk of overwriting another file
+- " Rename to a weird name to avoid the risk of overwriting another file
let nm = expand("<afile>")
++
++ " for gzip check current compression level and set b:gzip_comp_arg.
++ silent! unlet b:gzip_comp_arg
++
++ " Rename to a weird name to avoid the risk of overwriting another file
let nmt = expand("<afile>:p:h") . "/X~=@l9q5"
+ let nmte = nmt . "." . expand("<afile>:e")
+ if rename(nm, nmte) == 0