On Wed, May 10, 2006 at 09:22:06AM +0200, Zdenek Sekera wrote:
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > Sent: 10 May 2006 05:27
> > To: Vim mailing list
> > Subject: Inexplicable Error Running Script
> > 
> > I notice that a script I sometimes use to automatically check in files
> > with RCS when I save a file gives error under the new Vim 7.x but did
> > not under Vim 6.4.
> > 
> > Here is the script:
> > 
> > ==== Begin script autoci
> > if version >= 600
> >   if has("autocmd") 
> >     syntax enable
> >     function! s:RCSCheckIn()
> >       cd %:p:h
> >       exe '!ci -l -m"'.strftime("%Y %b %d %X").'" -t- %:t'
> >       cd -
> >     endfuction
>            ^n   (endfunction)
> 
> This is your problem throughout.
> Don't know why would it work in 6.4, it shouldn't have.
> 
> ---Zdenek
> 
> >     function! s:HiStatusLines()
> >       hi StatusLine   ctermfg=0 ctermbg=1 guifg=Black 
> > guibg=Red term=bold
> >       hi StatusLineNC ctermfg=0 ctermbg=1 guifg=Black guibg=DarkGreen
> >     endfuction
>           ^n  
> 
> 
> 
> >     augroup autoci
> >       au!
> >       autocmd BufWrite * exe 'silent call <sid>RCSCheckIn()' 
> >       autocmd FileType * exe 'silent call <sid>HiStatusLines()' 
> >     augroup END
> >   endif " has("autocmd")
> > endif
> > ==== E n d script autoci

Thanks to everyone who pointed out my typo.  The only way I can think of
to explain it working before was if :function and/or :augroup ends the
scope of an earlier :function block.  There may have been some wierdness
I did not notice before, but at least it is fixed now.

Reply via email to