Thread: [Vim-latex-devel] Re: A bug in templates.vim
Brought to you by:
srinathava,
tmaas
From: Srinath A. <sr...@fa...> - 2003-11-25 10:14:18
|
[I am resending this e-mail because I got a very cryptic mail failed message from MAILER-DAEMON@Knoppix...] Hi LB, On Sun, 16 Nov 2003, Zhang Lin-bo wrote: > In the second patch file, folding-patch, are some > enhancements to syntax folding. Most of them are > mainly based on my personal taste, please decide > on your judgement on whether to incorporate > (some of) them into the official releases :-) Thanks for the patches... I have been pretty busy nowadays with other things, hence the late reply... I have an idea about folding... It is possible that people have entirely different preferences when it comes to the level of folding... So I have a suggestion. Why not introduce a setting like g:Tex_FoldedItems which will be a comma seperated list of the things which people might want folded... And then each of the lines like: " {{{ equation/eqnarray call AddSyntaxFoldItem ( \ '^\s*\\begin{eq', \ '^\s*\\end{eq', \ 0, \ 0 \ ) " }}} can be replaced by " {{{ equation/eqnarray if g:Tex_FoldedItems =~ '\<eq\>' call AddSyntaxFoldItem ( \ '^\s*\\begin{eq', \ '^\s*\\end{eq', \ 0, \ 0 \ ) endif " }}} I would be more than happy to include a patch if you take the time to make a change along these lines... That way the default setting can include only the basic latex and amslatex items as Mikolaj suggests, but users can easily extend it using the setting... Thanks, Srinath |
From: Zhang L. <zl...@ls...> - 2003-11-28 14:35:28
Attachments:
folding.vim
|
Hi, Srinath, I have modified folding.vim (see attachment) to create fold items based on some lists. Since it is not easy to define a clean syntax to cover all situations with a single list, I have created three separate lists for folding environments (g:Tex_FoldedEnvironments), commands with a single argument (g:Tex_FoldedCommands), and sectioning commands (g:Tex_FoldedSections), respectively. Fold items not falling into these categories are handled directly as before. The handling of sectioning commands is implemented using a recursive function (FoldSections()). The limitation on the recursion depth shouldn't be a problem because we only have a limited number of sectioning commands. I have also added '<<<' and '>>>' as special markers for users to manually fold a region. The default settings of these lists are enclosed within "if exists('g:Tex_Foldedxxxxx') ... endif", thus users can set their own default values for them in any startup scripts (like ~/.vimrc). E.g., let g:Tex_FoldedEnvironments = '' will supress folding of environments. Please check the code when you have time. Thanks, LB Srinath Avadhanula wrote: >[I am resending this e-mail because I got a very cryptic mail failed >message from MAILER-DAEMON@Knoppix...] > >Hi LB, > >On Sun, 16 Nov 2003, Zhang Lin-bo wrote: > > > >>In the second patch file, folding-patch, are some >>enhancements to syntax folding. Most of them are >>mainly based on my personal taste, please decide >>on your judgement on whether to incorporate >>(some of) them into the official releases :-) >> >> > >Thanks for the patches... I have been pretty busy nowadays with other >things, hence the late reply... > >I have an idea about folding... It is possible that people have entirely >different preferences when it comes to the level of folding... So I have >a suggestion. Why not introduce a setting like g:Tex_FoldedItems which >will be a comma seperated list of the things which people might want >folded... And then each of the lines like: > > " {{{ equation/eqnarray > call AddSyntaxFoldItem ( > \ '^\s*\\begin{eq', > \ '^\s*\\end{eq', > \ 0, > \ 0 > \ ) > " }}} > >can be replaced by > > " {{{ equation/eqnarray > if g:Tex_FoldedItems =~ '\<eq\>' > call AddSyntaxFoldItem ( > \ '^\s*\\begin{eq', > \ '^\s*\\end{eq', > \ 0, > \ 0 > \ ) > endif > " }}} > > >I would be more than happy to include a patch if you take the time to >make a change along these lines... That way the default setting can >include only the basic latex and amslatex items as Mikolaj suggests, but >users can easily extend it using the setting... > >Thanks, >Srinath > > > |
From: Zhang L. <zl...@ls...> - 2003-11-29 02:35:49
Attachments:
folding.zip
|
Hi again, I modified the function TexFoldTextFunction() to better display information about the folded environments. Attached is the new folding.vim file (this time zipped). Best, LB |
From: Zhang L. <zl...@ls...> - 2003-11-29 07:18:06
Attachments:
folding.zip
|
Hi, Srinath, I'm sorry that I have modified folding.vim again in which the user defined g:Tex_Foldedxxxxx lists are appended (respectively prepended) to the default lists, if they start (respectively end) with ',', otherwise they replace the default value. I think this adds more flexibility for users who wish to add new environments/commands to be folded to the default ones. Attached is the new version of folding.vim. If you have not looked at the previous ones, please just look at this one. Thanks. Best, LB |
From: Srinath A. <sr...@fa...> - 2003-11-29 09:59:18
|
Hi LB, Thanks very much for the patches. I really like them :) I have been meaning to have customization of the folding stuff for ages. I have added the new stuff into the latest CVS head. I do not think I will backport it to the 1.5 branch, because that has gone into a feature-freeze. It will ofcourse be a part of the "Latest Developement Version" on the vim-latex download page. On Sat, 29 Nov 2003, Zhang Linbo wrote: > in which the user defined g:Tex_Foldedxxxxx lists > are appended (respectively prepended) to the default > lists, if they start (respectively end) with > ',', otherwise they replace the default value. Thats pretty neat. Its pretty late right now, so I will put off making the developement release till tomorrow. In the meanwhile, please checkout the latest from CVS and see if every thing is okay. Ofcourse, a big TODO is writing up documentation for this... I will do it if you feel you have already done too much :) Thanks, Srinath |
From: Zhang L. <zl...@ls...> - 2003-11-30 01:59:17
Attachments:
diff
|
Srinath Avadhanula wrote: >Hi LB, > >Thanks very much for the patches. I really like them :) I have been >meaning to have customization of the folding stuff for ages. I have >added the new stuff into the latest CVS head. > > Thanks for sorting out the code and I'm glad that you like it ;-) > Its pretty late right now, so I will put off making the developement > >release till tomorrow. In the meanwhile, please checkout the latest from >CVS and see if every thing is okay. > > I have moved the processing of the 'title' command before other standard commands/environments, otherwise it might be obsoleted by the 'titlepage' environment. The patch file is attached. This item might not be appropriate for all users because the \title and \maketitle commands are not always together, e.g., some people like to put the \title, \author, etc., commands in the preamble. So we might need to delete it from the default list. >Ofcourse, a big TODO is writing up documentation for this... I will do >it if you feel you have already done too much :) > > > It's little work compared to what you have done ;-) But please do write the documentation since I have never worked with the xml stuffs, and my english is not as good as well ;-( Another improvement I'm thinking of is to allow some kind of wildcards in the syntax match patterns. E.g., we can say: startpat='\s*\\begin\zs[:alpha:]*\ze' endpat='\s*\\end\zs[:alpha:]*\ze', ('\zs...\ze' in endpat is replaced by the actual matchstr when searching for the end pattern) to fold all '\beginxxxx ... \endxxxx' pairs, and: let g:TexFoldedEnvironments = '\zs[:alpha:]*\ze' to fold all environments. Also it would be nice if lines between '\begin{verbatim' and '\end{verbatim' can be skipped when searching for start/end patterns. I won't try the above enhancements until I have enough free time (I still have a lot to learn with Vim's scripting language in order to understand your MakeSyntaxFolds() function ;-) - It should be much easier for you to do them when you have time :-) ) Best, LB |
From: Zhang L. <zl...@ls...> - 2003-11-30 09:13:16
Attachments:
diff
|
Hi, Srinath, I have found another two small bugs in folding.vim, attached are the patches against current CVS. 1. '\item' should be put before the Environments (it might appear within a folded environment). 2. The '~' was missing in the test: if g:Tex_FoldedMisc =~ '\(^\|,\)<<<\(,\|$\)' Best, LB |
From: Srinath A. <sr...@fa...> - 2003-11-30 11:25:03
|
Hi LB, On Sun, 30 Nov 2003, Zhang Linbo wrote: > Hi, Srinath, > > I have found another two small bugs in folding.vim, > attached are the patches against current CVS. > I just made a few changes to folding.vim... The patch seems to not work with the latest CVS... Could I ask you to resubmit it against the latest CVS? No problem if you cannot. I will then do it manually later... Thanks, Srinath |
From: Zhang L. <zl...@ls...> - 2003-11-30 11:51:22
Attachments:
diff
|
Srinath Avadhanula wrote: >Hi LB, > >I just made a few changes to folding.vim... The patch seems to not work >with the latest CVS... Could I ask you to resubmit it against the latest >CVS? No problem if you cannot. I will then do it manually later... > > > Here are the patches against newest CVS. Hope they'll work ;-) Best, LB |
From: Zhang L. <zl...@ls...> - 2003-11-30 12:34:21
Attachments:
diff
|
Hi, Srinath, I'm sorry there're still some bugs in folding.vim, please see attached diff (it should be applied after the one I have just sent out). I think that the current code for the g:Tex_FoldedCommands list should be modified. For example, if we have a complete \footnote command on a single line, then all lines following it will be folded. I don't know how to define a proper pattern to skip commands on a single line :-( Another thing: I don't know what the 'TexLet' command is for, maybe should we change 'let' in folding.vim to 'TexLet'? Best, LB |
From: Srinath A. <sr...@fa...> - 2003-11-30 23:26:57
|
Hey LB, It looks like there was a problem sending this e-mail... It might have got cut off halfway through or something... Could you please resend it to me... Also, from now on, please reply or send any diffs just to me, not to the vim-latex-devel group, since I apply the patches anyway. Thanks, Srinath On Sun, 30 Nov 2003, Zhang Linbo wrote: > Hi, Srinath, > > I'm sorry there're still some bugs in folding.vim, > please see attached diff (it should be applied > after the one I have just sent out). > > I think that the current code for the g:Taaazzzaaazzzaaazzzaaazzzaaazzz > |