Re: [Vim-latex-devel] Completion of Tcommands
Brought to you by:
srinathava,
tmaas
From: Srinath A. <sr...@fa...> - 2003-07-15 07:14:43
|
A bit more discussion... On Tue, 15 Jul 2003, Luc Hermitte wrote: > - Why > exec 'silent! 0r! '.g:Tex_CatCmd.' '.a:filename > and not just: > if fileexists(a:filename) > exec 'silent! 0r '.a:filename > endif > ? > It would reduce the problems we can experience because of external > programs -- another source of headaches. I tried doing :r {fname} before but found that it actually creates a new buffer in the process. I think that creating unused buffers is a greater evil than spawning a shell command. If you notice, I take a lot of care to only create one temporary buffer in a session. Also r! {fname} seems to spawn the shell in the background in gvim, so its not too intrusive... I submitted a feature request about a function filecontents() in vim which would basically return a <NL> seperated string of the contents of a file, but I have a feeling its going to be neglected like always. Sometimes I really wish viml had a few more basic building blocks. > - Why > if search(a:regexp, 'w') > let retVal = 1 > else > let retVal = 0 > endif > instead of: > let reVal = search(a:regexp, 'w') > 0 > ? > I'm a militant for the direct use of boolean expressions whenever we > have "if expression then a=true else a=false endif" :) > Heh :) I guess it does make things more compact. I would go so far as to say that I should have simply done: let retVal = search(..., ...) I have only rarely used booleans in places other than if statements etc... But I guess logical expressions are not really consistent across languages. For example, in vim: echo 2 && 3 prints 1 whereas in python (which is becoming my favorite language), print 2 and 3 will print 3 (which seems more logical actually as far as expression short-circuiting goes... for example, you could do something = istrue and file.readlines() will make something contain the contents of the file if istrue is true, a sort of if then statement. ) So whats correct? Depending on return values from boolean algebra might lead to inconsistencies, so be warned. BTW, Luc: how did you get the logic for what steps to follow to generate the DVI file correctly? I notice that TKMakeDVI first runs bibtex if file.aux contains \bibdata even before running latex. But this seems to be incorrect in situations where the modification is to remove a bibliographic entry... i.e, if initially the file contained \bibliography{fname} and I removed this line or changed fname and then did TKMakeDVI, then it would wrongly make bibtex scan fname... I hope you see the problem. Thanks, Srinath |