Re: [Vim-latex-devel] What to do about removed files?
Brought to you by:
srinathava,
tmaas
From: Srinath A. <sr...@fa...> - 2004-03-10 18:56:25
|
On Wed, 10 Mar 2004, Alan Schmitt wrote: > > 1. Have the zip file overwrite the original file with an empty file. > > 2. Have a little function in main.vim which checks for the existence of > > the original file (which should now be empty). > > --> If found, then delete it. > > If there is an error in deletion, give an error message. > > > > The problem with this approach is that this will mean that main.vim will > > have a little bit of extra computation every time... > > I like this approach ... I don't think the extra work will slow things > too much (it's only done once, when the plugin is loaded, right?). > I thought of something which looks even better :) Suppose ftplugin/tex/texviewer.vim is a placeholder file kept there to overwrite the previous version. Then make a new ftplugin/tex/texviewer.vim which contains something like this: ---- start ftplugin/tex/texviewer.vim ----- if g:Tex_DontRemoveTempFiles finish endif augroup TexRemoveTempFiles au VimLeave * :silent! call delete(expand('<sfile>:p')) augroup END ---- end ftplugin/tex/texviewer.vim ----- This essentially means that ftplugin/tex/texviewer.vim essentially removes itself (suicide?) when latex-suite first runs and then the user exits. This means no more code addition in main.vim... The initial "if g:Tex_DontRemoveTempFiles" is just so I can set g:Tex_DontRemoveTempFiles to ensure that the file doesn't keep dissapearing from my hard-disk when I do testing. I think I'll use this strategy. Srinath |