vim-latex-cvs Mailing List for Vim-Latex (Page 26)
Brought to you by:
srinathava,
tmaas
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(82) |
Dec
(124) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(104) |
Feb
(3) |
Mar
(6) |
Apr
(48) |
May
(34) |
Jun
(62) |
Jul
(33) |
Aug
(24) |
Sep
(32) |
Oct
(16) |
Nov
(36) |
Dec
(39) |
2004 |
Jan
|
Feb
(3) |
Mar
(8) |
Apr
|
May
(29) |
Jun
(13) |
Jul
(4) |
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
(6) |
Dec
(9) |
2006 |
Jan
(9) |
Feb
(2) |
Mar
(16) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(1) |
Jul
|
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
(17) |
Sep
(3) |
Oct
(4) |
Nov
(1) |
Dec
(3) |
2010 |
Jan
(25) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(8) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
(10) |
Oct
(1) |
Nov
|
Dec
(1) |
2012 |
Jan
(5) |
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(4) |
Nov
(1) |
Dec
|
2013 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(15) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
From: <sri...@us...> - 2003-01-17 06:41:28
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv32346 Modified Files: custommacros.vim Log Message: - Use Tex_ChooseFromPrompt instead of Tex_ChooseFile Index: custommacros.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/custommacros.vim,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** custommacros.vim 12 Jan 2003 22:02:38 -0000 1.12 --- custommacros.vim 17 Jan 2003 06:37:58 -0000 1.13 *************** *** 52,55 **** --- 52,67 ---- " }}} + " ChooseMacro: choose a macro file {{{ + " " Description: + function! s:ChooseMacro(ask) + let pwd = getcwd() + exe 'cd '.s:path.'/macros' + let filename = Tex_ChooseFromPrompt( + \ a:ask."\n" . + \ Tex_CreatePrompt(glob('*'), 2, "\n") . + \ "\nEnter number or filename :", + \ glob('*'), "\n") + exe 'cd '.pwd + endfunction " }}} " DeleteMacro: deletes macro file {{{ function! <SID>DeleteMacro(...) *************** *** 59,63 **** let pwd = getcwd() exe 'cd '.s:path.'/macros' ! let filename = Tex_ChooseFile('Choose a macro file for deletion :') exe 'cd '.pwd endif --- 71,75 ---- let pwd = getcwd() exe 'cd '.s:path.'/macros' ! let filename = s:ChooseMacro('Choose a macro file for deletion :') exe 'cd '.pwd endif *************** *** 79,83 **** let pwd = getcwd() exe 'cd '.s:path.'/macros' ! let filename = Tex_ChooseFile('Choose a macro file for insertion:') exe 'cd '.pwd endif --- 91,95 ---- let pwd = getcwd() exe 'cd '.s:path.'/macros' ! let filename = s:ChooseMacro('Choose a macro file for insertion:') exe 'cd '.pwd endif *************** *** 98,102 **** let pwd = getcwd() exe 'cd '.s:path.'/macros' ! let filename = Tex_ChooseFile('Choose a macro file for insertion:') exe 'cd '.pwd endif --- 110,114 ---- let pwd = getcwd() exe 'cd '.s:path.'/macros' ! let filename = s:ChooseMacro('Choose a macro file for insertion:') exe 'cd '.pwd endif |
From: <sri...@us...> - 2003-01-17 05:26:36
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv28011 Modified Files: packages.vim Log Message: - Use Tex_ChooseFromPrompt instead of Tex_ChooseFile - Also create global variables of the form g:Tex_{packname}_options which contains options corresponding to \usepackage{packname}. Index: packages.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages.vim,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** packages.vim 16 Jan 2003 17:49:08 -0000 1.24 --- packages.vim 17 Jan 2003 05:26:34 -0000 1.25 *************** *** 96,100 **** let pwd = getcwd() exe 'cd '.s:path.'/packages' ! let packname = Tex_ChooseFile('Choose a package: ') exe 'cd '.pwd if packname != '' --- 96,104 ---- let pwd = getcwd() exe 'cd '.s:path.'/packages' ! let packname = Tex_ChooseFromPrompt( ! \ "Choose a package: \n" . ! \ Tex_CreatePrompt(glob('*'), 3, "\n") . ! \ "\nEnter number or filename :", ! \ glob('*'), "\n") exe 'cd '.pwd if packname != '' *************** *** 129,136 **** " Tex_pack_all: scans the current file for \usepackage{} lines {{{ " and if supported, loads the options and commands found in the ! " corresponding package file. ! " Now scans also for \newenvironment and \newcommand lines and adds names to ! " g:Tex_Prompted variables, they can be easy available through <F5> and <F7> ! " shortcuts function! Tex_pack_all() --- 133,139 ---- " Tex_pack_all: scans the current file for \usepackage{} lines {{{ " and if supported, loads the options and commands found in the ! " corresponding package file. Also scans for \newenvironment and ! " \newcommand lines and adds names to g:Tex_Prompted variables, they can be ! " easy available through <F5> and <F7> shortcuts function! Tex_pack_all() *************** *** 163,166 **** --- 166,181 ---- let saveA = @a + " If there are options, then find those. + if getline('.') =~ '\\usepackage\[.\{-}\]' + let options = matchstr(getline('.'), '\\usepackage\[\zs.\{-}\ze\]') + elseif getline('.') =~ '\\usepackage\[' + " Entering here means that the user has split the \usepackage + " across newlines. Therefore, use yank. + exec "normal! /\[\<CR>lv/\]\<CR>h\"ay" + let options = @a + else + let options = '' + endif + " The following statement puts the stuff between the { }'s of a " \usepackage{stuff,foo} into @a. Do not use matchstr() and the like *************** *** 183,186 **** --- 198,210 ---- " Should we bother taking care of this? let g:Tex_package_detected = g:Tex_package_detected.','.@a + + " For each package found, form a global variable of the form + " g:Tex_{packagename}_options + " which contains a list of the options. + let j = 1 + while Tex_Strntok(@a, ',', j) != '' + let g:Tex_{Tex_Strntok(@a, ',', j)}_options = options + let j = j + 1 + endwhile " Finally convert @a into something like '"pack1","pack2"' |
From: <sri...@us...> - 2003-01-16 17:49:11
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv11190 Modified Files: packages.vim Log Message: - Previously if a file which didn't have \usepackage{german} triggered latex-suite and then the user opened a file which did have \usepackage{german}, then b:Tex_SmartQuote* would not change. We want to process the \usepackage lines for every file... A first pass at implementing this. Make Tex_pack_updateall() get called every time SetTeXOptions() is called by catching the LatexSuiteInit event thrown by SetTeXOptions(). TODO: This makes things slow, because Tex_pack_updateall is kind of dumb updating the menu list... Often times, multiple files in the same vim session use the same main file. In this case, it doesn't make sense to "uncheck" all the menus and recreate them again. I'll optimize it later to use such information... Index: packages.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages.vim,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** packages.vim 15 Jan 2003 02:53:34 -0000 1.23 --- packages.vim 16 Jan 2003 17:49:08 -0000 1.24 *************** *** 454,456 **** --- 454,460 ---- endif + augroup LatexSuite + au LatexSuite User LatexSuiteInit call Tex_pack_updateall() + augroup END + " vim:fdm=marker:ts=4:sw=4:noet:ff=unix |
From: Benji F. <be...@me...> - 2003-01-16 17:47:55
|
Mikolaj Machowski wrote: > On Wed, Jan 15, 2003 at 06:39:00PM -0800, Srinath Avadhanula wrote: > >>On Wed, 15 Jan 2003, Benji Fisher wrote: >> >>>:execute "source" expand("%:p:h") . "/german" >>> >> >>Agreed. Although it should be: >>execute 'source '.expand('<sfile>:p:h').'/german' >>(<sfile> instead of %) >> >>>\usepackage[german]{babel} >>> >>>instead of >>> >>>\usepackage{german} >>> >> >>As of now, there isn't. During the scan for \usepcackage's, the >>g:Tex_pack_supported is created which lists the packages detected... >>Unless a variable like g:Tex_{pack}_options or something similar is >>created, this is not possible. This is actually not too hard to >>implement, but even if it is implemented, I dont know how to make >>the tex quotes function use this information. We will have to revert to >>the strategy of modifying that function itself... (But I dont like that >>strategy too much because its not really scalable). >>Any ideas? > > > Here simple solution > package file 'babel': > ------- > function! Lookfor() > let g:pos = line('.').' | normal! '.virtcol('.').'|' > let g:line = search('\\usepackage.*{babel}', 'w') > if getline(g:line) =~ 'german' > source $VIMLATEXMAINPATH/packages/german > endif > exe g:pos > endfunction > > call Lookfor() > > " vim:ft=vim:ff=unix: > --------- > Works for me. Aha, small cheat: $VIMLATEXMAINPATH is defined > in main.vim. IMO this is not bad idea - calculating path in each file > which needs this information in not very clear. > > But this in not necessarily good solution. This sources whole package > file with its menus and specific commands which is not always cause with > babel package. IIRC this turns on only hyphenation, gives access to > special letters, and redefines \chapter and similar commands. For > (n)german it works. I have wonderful polski package which does many, > many more. Maybe Luc can say more? > > m. > > ps. To Srinath: g: variables are only for debugging purposes ;) I was going to ask about the g: vars. Why wrap it in a function? Just use s: instead of g: . Or do you see the Lookfor() function as being needed in other scripts? I only write in English, so I am not familiar with the difference between \usepackage[mylang]{babel} and \usepackage{mylang} . That said, I have a suggestion: have files babel, german, and german-babel (or babel-german or even babel/german) in the packages directory. The german file, and the babel file if german is given as an option, will :source the german-babel file. So far, the german file will not do anything else, but it may in the future. I would rather parse the \usepackage[...]{babel} line more carefully, rather than just test whether it matches 'german'. --Benji |
From: <sri...@us...> - 2003-01-16 17:42:12
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv10046 Modified Files: main.vim Log Message: - Previously if a file which didn't have \usepackage{german} triggered latex-suite and then the user opened a file which did have \usepackage{german}, then b:Tex_SmartQuote* would not change. We want to process the \usepackage lines for every file... A first pass at implementing this. As a long term solution, make SetTeXOptions() trigger a user autocommand called LatexSuiteInit. This is caught by everyone who so wishes. This enables us to not have to modify main.vim everytime... Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** main.vim 16 Jan 2003 02:49:57 -0000 1.33 --- main.vim 16 Jan 2003 17:42:09 -0000 1.34 *************** *** 35,38 **** --- 35,42 ---- exe "so ".s:path.'/texrc' + augroup LatexSuite User LatexSuiteInit + au! + augroup END + " }}} *************** *** 579,582 **** --- 583,588 ---- " the first compiler plugin in 'runtimepath'. runtime compiler/tex.vim + + silent! do LatexSuite User LatexSuiteInit endfunction |
From: Mikolaj M. <mi...@wp...> - 2003-01-16 17:24:55
|
On Wed, Jan 15, 2003 at 06:39:00PM -0800, Srinath Avadhanula wrote: > On Wed, 15 Jan 2003, Benji Fisher wrote: > > :execute "source" expand("%:p:h") . "/german" > > > Agreed. Although it should be: > execute 'source '.expand('<sfile>:p:h').'/german' > (<sfile> instead of %) > > \usepackage[german]{babel} > > > > instead of > > > > \usepackage{german} > > > As of now, there isn't. During the scan for \usepcackage's, the > g:Tex_pack_supported is created which lists the packages detected... > Unless a variable like g:Tex_{pack}_options or something similar is > created, this is not possible. This is actually not too hard to > implement, but even if it is implemented, I dont know how to make > the tex quotes function use this information. We will have to revert to > the strategy of modifying that function itself... (But I dont like that > strategy too much because its not really scalable). > Any ideas? Here simple solution package file 'babel': ------- function! Lookfor() let g:pos = line('.').' | normal! '.virtcol('.').'|' let g:line = search('\\usepackage.*{babel}', 'w') if getline(g:line) =~ 'german' source $VIMLATEXMAINPATH/packages/german endif exe g:pos endfunction call Lookfor() " vim:ft=vim:ff=unix: --------- Works for me. Aha, small cheat: $VIMLATEXMAINPATH is defined in main.vim. IMO this is not bad idea - calculating path in each file which needs this information in not very clear. But this in not necessarily good solution. This sources whole package file with its menus and specific commands which is not always cause with babel package. IIRC this turns on only hyphenation, gives access to special letters, and redefines \chapter and similar commands. For (n)german it works. I have wonderful polski package which does many, many more. Maybe Luc can say more? m. ps. To Srinath: g: variables are only for debugging purposes ;) |
From: <mi...@us...> - 2003-01-16 11:09:24
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages In directory sc8-pr-cvs1:/tmp/cvs-serv30603 Modified Files: ngerman Log Message: localized to buffer SmartQuotes Index: ngerman =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/ngerman,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ngerman 15 Jan 2003 23:14:51 -0000 1.1 --- ngerman 16 Jan 2003 11:09:22 -0000 1.2 *************** *** 1,5 **** " For now just define the smart quotes. ! let g:Tex_SmartQuoteOpen = '"`' ! let g:Tex_SmartQuoteClose = "'\"" " vim:ft=vim:ff=unix: --- 1,5 ---- " For now just define the smart quotes. ! let b:Tex_SmartQuoteOpen = '"`' ! let b:Tex_SmartQuoteClose = "\"'" " vim:ft=vim:ff=unix: |
From: Srinath A. <sr...@fa...> - 2003-01-16 07:02:04
|
On Wed, 15 Jan 2003, Benji Fisher wrote: > I was thinking that if babel is one of the packages found, then > whatever language is given as an option should be added as a package. > If the file contains > > \usepackage[foo]{babel} > > then pretend that it includes > > \usepackage{foo} This is still going to require that we scan for options and create a variable such as g:Tex_{package}_options Now Tex_pack_all() scans the file looking for \usepackage's... I do not think it will be a good idea to make it also do something based on which pacakges it found and what options were used in each etc. That approach will mean that each time we come across a new issue like this, we will have to change that function... What about something more "long term"... I was recently looking at the excellent cvscommand.vim plugin and one thing which that plugin uses, which we haven't done so far is user generated autcommands... I think using this mechanism is one way to go... After the initial scan for \usepackage's, Tex_pack_all() throws an event: silent! do TexPackages User TexPackagesScanned If a package wants to, it can catch this event. For example, packages/babel could do: augroup TexPackages au TexPackages User TexPackagesScanned call SetQuotes() augroup END fun! SetQuotes() if g:Tex_pack_supported =~ babel if g:Tex_babel_option =~ 'german' let open = "\"`" let close = "\"'" elseif g:Tex_babel_option =~ 'french' let open = '<<' let close = '>>' endif endif endfun This mechanism effectively lets each package work for itself without making Tex_pack_all() do it... > Perhaps one way to do this would be to add a packages/babel file that > finds the options, and fakes including the packages. The package files should not be required to scan for \usepackage's and what options were used etc. That should be done by some latex-suite function like Tex_pack_all(). The package files should only have the intelligence to use this information in some way... Although this mechanism might seem complicated at first glance, I do not think it is... The advantage is that it will be eminently scalable... Using this mechanism, we might even have gotten away with not creating the german and ngerman packages at all... Just creating the SetQuotes function and the autocommand above would have been sufficient... Srinath |
From: Benji F. <be...@me...> - 2003-01-16 04:43:07
|
Srinath Avadhanula wrote: > On Wed, 15 Jan 2003, Benji Fisher wrote: > > >>:execute "source" expand("%:p:h") . "/german" >> > > > Agreed. Although it should be: > > execute 'source '.expand('<sfile>:p:h').'/german' > > (<sfile> instead of %) > > >>\usepackage[german]{babel} >> >>instead of >> >>\usepackage{german} >> > > As of now, there isn't. During the scan for \usepcackage's, the > g:Tex_pack_supported is created which lists the packages detected... > Unless a variable like g:Tex_{pack}_options or something similar is > created, this is not possible. This is actually not too hard to > implement, but even if it is implemented, I dont know how to make > the tex quotes function use this information. We will have to revert to > the strategy of modifying that function itself... (But I dont like that > strategy too much because its not really scalable). > > Any ideas? I was thinking that if babel is one of the packages found, then whatever language is given as an option should be added as a package. If the file contains \usepackage[foo]{babel} then pretend that it includes \usepackage{foo} Perhaps one way to do this would be to add a packages/babel file that finds the options, and fakes including the packages. --Benji |
From: <sri...@us...> - 2003-01-16 02:49:59
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv20709 Modified Files: main.vim Log Message: - made greek letter expansions also use g:Tex_Leader. This provides another way in which users can avoid unexpected expansions... (I dont know why this was not the case till now...) TODO: make greek letters optional. - Bug fix: Tex_CreatePrompt was not using a:sep throughout, causing it to be broken for lists which were not , seperated. - New function Tex_ChooseFromPrompt. This function will in the future replace the Tex_ChooseFile function... Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** main.vim 15 Jan 2003 16:16:27 -0000 1.32 --- main.vim 16 Jan 2003 02:49:57 -0000 1.33 *************** *** 94,134 **** " }}} " Greek Letters {{{ ! call IMAP('`a', '\alpha', 'tex') " {{{ ! call IMAP('`b', '\beta', 'tex') ! call IMAP('`c', '\chi', 'tex') ! call IMAP('`d', '\delta', 'tex') ! call IMAP('`e', '\varepsilon', 'tex') ! call IMAP('`f', '\varphi', 'tex') ! call IMAP('`g', '\gamma', 'tex') ! call IMAP('`h', '\eta', 'tex') ! call IMAP('`k', '\kappa', 'tex') ! call IMAP('`l', '\lambda', 'tex') ! call IMAP('`m', '\mu', 'tex') ! call IMAP('`n', '\nu', 'tex') ! call IMAP('`p', '\pi', 'tex') ! call IMAP('`q', '\theta', 'tex') ! call IMAP('`r', '\rho', 'tex') ! call IMAP('`s', '\sigma', 'tex') ! call IMAP('`t', '\tau', 'tex') ! call IMAP('`u', '\upsilon', 'tex') ! call IMAP('`v', '\varsigma', 'tex') ! call IMAP('`w', '\omega', 'tex') ! call IMAP('`w', '\wedge', 'tex') " AUCTEX style ! call IMAP('`x', '\xi', 'tex') ! call IMAP('`y', '\psi', 'tex') ! call IMAP('`z', '\zeta', 'tex') " not all capital greek letters exist in LaTeX! " reference: http://www.giss.nasa.gov/latex/ltx-405.html ! call IMAP('`D', '\Delta', 'tex') ! call IMAP('`F', '\Phi', 'tex') ! call IMAP('`G', '\Gamma', 'tex') ! call IMAP('`Q', '\Theta', 'tex') ! call IMAP('`L', '\Lambda', 'tex') ! call IMAP('`X', '\Xi', 'tex') ! call IMAP('`Y', '\Psi', 'tex') ! call IMAP('`S', '\Sigma', 'tex') ! call IMAP('`U', '\Upsilon', 'tex') ! call IMAP('`W', '\Omega', 'tex') ! " }}} " }}} " ProtectLetters: sets up indentity maps for things like ``a {{{ --- 94,133 ---- " }}} " Greek Letters {{{ ! call IMAP(g:Tex_Leader.'a', '\alpha', 'tex') ! call IMAP(g:Tex_Leader.'b', '\beta', 'tex') ! call IMAP(g:Tex_Leader.'c', '\chi', 'tex') ! call IMAP(g:Tex_Leader.'d', '\delta', 'tex') ! call IMAP(g:Tex_Leader.'e', '\varepsilon', 'tex') ! call IMAP(g:Tex_Leader.'f', '\varphi', 'tex') ! call IMAP(g:Tex_Leader.'g', '\gamma', 'tex') ! call IMAP(g:Tex_Leader.'h', '\eta', 'tex') ! call IMAP(g:Tex_Leader.'k', '\kappa', 'tex') ! call IMAP(g:Tex_Leader.'l', '\lambda', 'tex') ! call IMAP(g:Tex_Leader.'m', '\mu', 'tex') ! call IMAP(g:Tex_Leader.'n', '\nu', 'tex') ! call IMAP(g:Tex_Leader.'p', '\pi', 'tex') ! call IMAP(g:Tex_Leader.'q', '\theta', 'tex') ! call IMAP(g:Tex_Leader.'r', '\rho', 'tex') ! call IMAP(g:Tex_Leader.'s', '\sigma', 'tex') ! call IMAP(g:Tex_Leader.'t', '\tau', 'tex') ! call IMAP(g:Tex_Leader.'u', '\upsilon', 'tex') ! call IMAP(g:Tex_Leader.'v', '\varsigma', 'tex') ! call IMAP(g:Tex_Leader.'w', '\omega', 'tex') ! call IMAP(g:Tex_Leader.'w', '\wedge', 'tex') " AUCTEX style ! call IMAP(g:Tex_Leader.'x', '\xi', 'tex') ! call IMAP(g:Tex_Leader.'y', '\psi', 'tex') ! call IMAP(g:Tex_Leader.'z', '\zeta', 'tex') " not all capital greek letters exist in LaTeX! " reference: http://www.giss.nasa.gov/latex/ltx-405.html ! call IMAP(g:Tex_Leader.'D', '\Delta', 'tex') ! call IMAP(g:Tex_Leader.'F', '\Phi', 'tex') ! call IMAP(g:Tex_Leader.'G', '\Gamma', 'tex') ! call IMAP(g:Tex_Leader.'Q', '\Theta', 'tex') ! call IMAP(g:Tex_Leader.'L', '\Lambda', 'tex') ! call IMAP(g:Tex_Leader.'X', '\Xi', 'tex') ! call IMAP(g:Tex_Leader.'Y', '\Psi', 'tex') ! call IMAP(g:Tex_Leader.'S', '\Sigma', 'tex') ! call IMAP(g:Tex_Leader.'U', '\Upsilon', 'tex') ! call IMAP(g:Tex_Leader.'W', '\Omega', 'tex') " }}} " ProtectLetters: sets up indentity maps for things like ``a {{{ *************** *** 366,370 **** let j = 0 while j < a:cols && i + j <= num_common ! let com = Tex_Strntok(a:promptList, ',', i+j) let promptStr = promptStr.'('.(i+j).') '. \ com."\t".( strlen(com) < 4 ? "\t" : '' ) --- 365,369 ---- let j = 0 while j < a:cols && i + j <= num_common ! let com = Tex_Strntok(a:promptList, a:sep, i+j) let promptStr = promptStr.'('.(i+j).') '. \ com."\t".( strlen(com) < 4 ? "\t" : '' ) *************** *** 412,415 **** --- 411,424 ---- " }}} + " Tex_ChooseFromPrompt: process a user input to a prompt string {{{ + " " Description: + function! Tex_ChooseFromPrompt(dialog, list, sep) + let inp = input(a:dialog) + if inp =~ '\d\+' + return Tex_Strntok(a:list, a:sep, inp) + else + return inp + endif + endfunction " }}} " Tex_ChooseFile: produces a file list and prompts for choice {{{ " Description: |
From: Srinath A. <sr...@fa...> - 2003-01-16 02:39:03
|
On Wed, 15 Jan 2003, Benji Fisher wrote: > :execute "source" expand("%:p:h") . "/german" > Agreed. Although it should be: execute 'source '.expand('<sfile>:p:h').'/german' (<sfile> instead of %) > \usepackage[german]{babel} > > instead of > > \usepackage{german} > As of now, there isn't. During the scan for \usepcackage's, the g:Tex_pack_supported is created which lists the packages detected... Unless a variable like g:Tex_{pack}_options or something similar is created, this is not possible. This is actually not too hard to implement, but even if it is implemented, I dont know how to make the tex quotes function use this information. We will have to revert to the strategy of modifying that function itself... (But I dont like that strategy too much because its not really scalable). Any ideas? Srinath |
From: Benji F. <be...@me...> - 2003-01-16 02:01:55
|
mi...@us... wrote: > Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages > In directory sc8-pr-cvs1:/tmp/cvs-serv32100 > > Added Files: > ngerman > Log Message: > new package file > > --- NEW FILE: ngerman --- > " For now just define the smart quotes. > let g:Tex_SmartQuoteOpen = '"`' > let g:Tex_SmartQuoteClose = "'\"" First of all, the close quote should be "' instead of '" . Second, is there any reason not to have simply :execute "source" expand("%:p:h") . "/german" in this file? Finally, is there any way to get these files :source'd when the file contains \usepackage[german]{babel} instead of \usepackage{german} ? --Benji |
From: <mi...@us...> - 2003-01-15 23:14:54
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages In directory sc8-pr-cvs1:/tmp/cvs-serv32100 Added Files: ngerman Log Message: new package file --- NEW FILE: ngerman --- " For now just define the smart quotes. let g:Tex_SmartQuoteOpen = '"`' let g:Tex_SmartQuoteClose = "'\"" " vim:ft=vim:ff=unix: |
From: <ma...@us...> - 2003-01-15 16:24:59
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages In directory sc8-pr-cvs1:/tmp/cvs-serv3373/ftplugin/latex-suite/packages Modified Files: german Log Message: Make the Tex_SmartQuote* variables buffer-local, and change the close-quote string from '" to "' . Index: german =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/german,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** german 14 Jan 2003 23:00:08 -0000 1.1 --- german 15 Jan 2003 16:24:56 -0000 1.2 *************** *** 1,5 **** " For now just define the smart quotes. ! let g:Tex_SmartQuoteOpen = '"`' ! let g:Tex_SmartQuoteClose = "'\"" " vim:ft=vim:ff=unix: --- 1,5 ---- " For now just define the smart quotes. ! let b:Tex_SmartQuoteOpen = '"`' ! let b:Tex_SmartQuoteClose = "\"'" " vim:ft=vim:ff=unix: |
From: <ma...@us...> - 2003-01-15 16:23:15
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv3118/ftplugin/latex-suite Modified Files: texrc Log Message: I updated the comments above the Tex_SmartQuoteOpen and Tex_SmartQuoteClose variables. Index: texrc =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/texrc,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** texrc 14 Jan 2003 13:40:56 -0000 1.20 --- texrc 15 Jan 2003 16:23:13 -0000 1.21 *************** *** 390,394 **** " Users of other languages might want to change the quote characters to suit ! " their locale. TexLet g:Tex_SmartQuoteOpen = "``" TexLet g:Tex_SmartQuoteClose = "''" --- 390,396 ---- " Users of other languages might want to change the quote characters to suit ! " their locale. These global values will be ignored if there are buffer-local ! " versions, which may be set in the language-specific package files, such as ! " ftplugin/latex-suite/packages/german TexLet g:Tex_SmartQuoteOpen = "``" TexLet g:Tex_SmartQuoteClose = "''" |
From: <ma...@us...> - 2003-01-15 16:16:30
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv2084/ftplugin/latex-suite Modified Files: main.vim Log Message: Several changes to the s:TexQuotes() function: * more comments * fix a bug, introduced in the previous patch, when inserting " in math mode or after \ . * Do not assume that the open- and close-quote strings can be distinguished by their first characters. (German uses "` and "'.) * Look for buffer-local versions of Tex_SmartQuoteOpen and Tex_SmartQuoteClose before using the global versions. Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** main.vim 15 Jan 2003 02:54:28 -0000 1.31 --- main.vim 15 Jan 2003 16:16:27 -0000 1.32 *************** *** 178,184 **** if g:Tex_SmartKeyQuote ! " TexQuotes: inserts `` or '' instead of " Taken from texmacro.vim by Benji Fisher <be...@e-...> " TODO: Deal with nested quotes. function! s:TexQuotes() let l = line(".") --- 178,186 ---- if g:Tex_SmartKeyQuote ! " TexQuotes: inserts `` or '' instead of " " Taken from texmacro.vim by Benji Fisher <be...@e-...> " TODO: Deal with nested quotes. + " The :imap that calls this function should insert a ", move the cursor to + " the left of that character, then call this with <C-R>= . function! s:TexQuotes() let l = line(".") *************** *** 188,198 **** let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor execute restore_cursor if synIDattr(synID(l, c, 1), "name") =~ "^texMath" \ || (c > 1 && getline(l)[c-2] == '\') ! return '"' endif - let open = exists("g:Tex_SmartQuoteOpen") ? g:Tex_SmartQuoteOpen : "``" - let close = exists("g:Tex_SmartQuoteClose") ? g:Tex_SmartQuoteClose : "''" let boundary = '\|' if exists("s:TeX_strictquote") if( s:TeX_strictquote == "open" || s:TeX_strictquote == "both" ) --- 190,219 ---- let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor execute restore_cursor + " In math mode, or when preceded by a \, just move the cursor past the + " already-inserted " character. if synIDattr(synID(l, c, 1), "name") =~ "^texMath" \ || (c > 1 && getline(l)[c-2] == '\') ! return "\<Right>" ! endif ! " Find the appropriate open-quote and close-quote strings. ! if exists("b:Tex_SmartQuoteOpen") ! let open = b:Tex_SmartQuoteOpen ! elseif exists("g:Tex_SmartQuoteOpen") ! let open = g:Tex_SmartQuoteOpen ! else ! let open = "``" ! endif ! if exists("b:Tex_SmartQuoteClose") ! let close = b:Tex_SmartQuoteClose ! elseif exists("g:Tex_SmartQuoteClose") ! let close = g:Tex_SmartQuoteClose ! else ! let close = "''" endif let boundary = '\|' + " This code seems to be obsolete, since this script variable is never + " set. The idea is that some languages use ",," as an open- or + " close-quote string, and we want to avoid confusing ordinary "," + " with a quote boundary. if exists("s:TeX_strictquote") if( s:TeX_strictquote == "open" || s:TeX_strictquote == "both" ) *************** *** 203,210 **** endif endif let q = open while 1 " Look for preceding quote (open or close), ignoring " math mode and '\"' . - " execute 'normal ?^$\|"\|' . open . boundary . close . "\r" call search(open . boundary . close . '\|^$\|"', "bw") if synIDattr(synID(line("."), col("."), 1), "name") !~ "^texMath" --- 224,231 ---- endif endif + " Eventually return q; set it to the default value now. let q = open while 1 " Look for preceding quote (open or close), ignoring " math mode and '\"' . call search(open . boundary . close . '\|^$\|"', "bw") if synIDattr(synID(line("."), col("."), 1), "name") !~ "^texMath" *************** *** 214,220 **** endwhile " Now, test whether we actually found a _preceding_ quote; if so, is it ! " and open quote? if ( line(".") < l || line(".") == l && col(".") < c ) ! if strlen(getline(".")) && (getline(".")[col(".")-1] == open[0]) if line(".") == l && col(".") + strlen(open) == c " Insert "<++>''<++>" instead of just "''". --- 235,242 ---- endwhile " Now, test whether we actually found a _preceding_ quote; if so, is it ! " an open quote? if ( line(".") < l || line(".") == l && col(".") < c ) ! if strpart(getline("."), col(".")-1) =~ ! \ '\V\^' . escape(open, '\') if line(".") == l && col(".") + strlen(open) == c " Insert "<++>''<++>" instead of just "''". |
From: <sri...@us...> - 2003-01-15 02:54:31
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv24135 Modified Files: main.vim Log Message: - new function Tex_CreatePrompt. " Description: " Arguments: " promptList: This is a string of the form: " 'item1,item2,item3,item4' " cols: the number of columns in the resultant prompt " sep: the list seperator token " " Example: " Tex_CreatePrompt('item1,item2,item3,item4', 2, ',') " returns " "(1) item1\t(2)item2\n(3)item3\t(4)item4" " " This string can be used in the input() function. Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** main.vim 14 Jan 2003 22:51:19 -0000 1.30 --- main.vim 15 Jan 2003 02:54:28 -0000 1.31 *************** *** 318,321 **** --- 318,362 ---- " }}} + " Tex_CreatePrompt: creates a prompt string {{{ + " Description: + " Arguments: + " promptList: This is a string of the form: + " 'item1,item2,item3,item4' + " cols: the number of columns in the resultant prompt + " sep: the list seperator token + " + " Example: + " Tex_CreatePrompt('item1,item2,item3,item4', 2, ',') + " returns + " "(1) item1\t(2)item2\n(3)item3\t(4)item4" + " + " This string can be used in the input() function. + function! Tex_CreatePrompt(promptList, cols, sep) + + let g:listSep = a:sep + let num_common = GetListCount(a:promptList) + + let i = 1 + let promptStr = "" + + while i <= num_common + + let j = 0 + while j < a:cols && i + j <= num_common + let com = Tex_Strntok(a:promptList, ',', i+j) + let promptStr = promptStr.'('.(i+j).') '. + \ com."\t".( strlen(com) < 4 ? "\t" : '' ) + + let j = j + 1 + endwhile + + let promptStr = promptStr."\n" + + let i = i + a:cols + endwhile + return promptStr + endfunction + + " }}} " Tex_CleanSearchHistory: removes last search item from search history {{{ " Description: This function needs to be globally visible because its |
From: <sri...@us...> - 2003-01-15 02:53:37
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv24020 Modified Files: packages.vim Log Message: - moved g:Tex_PromptedEnvironmentsDefault and g:Tex_PromptedCommandsDefault from envmacros.vim to here. Index: packages.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages.vim,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** packages.vim 14 Jan 2003 22:02:42 -0000 1.22 --- packages.vim 15 Jan 2003 02:53:34 -0000 1.23 *************** *** 26,29 **** --- 26,35 ---- let g:Tex_package_supported = '' let g:Tex_package_detected = '' + " Remember the defaults because we want g:Tex_PromptedEnvironments to contain + " in addition to the default, \newenvironments, and the \newenvironments might + " change... + let g:Tex_PromptedEnvironmentsDefault = g:Tex_PromptedEnvironments + let g:Tex_PromptedCommandsDefault = g:Tex_PromptedCommands + " Tex_pack_check: creates the package menu and adds to 'dict' setting. {{{ |
From: <sri...@us...> - 2003-01-15 02:52:51
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv23938 Modified Files: envmacros.vim Log Message: - instead of custom functions for creating prompt strings of environments/commands/templates/packages etc, use a function Tex_CreatePrompt() everywhere. See main.vim for usage details. It turns out the bug Mikolaj reported with the prompt not changing was becuause of a buggy SetUpCommandPrompt() function. TODO: There are many globally visible functions not starting with the Tex_ prefix. Will have to fix that soon. - Code cleanup: bugs where introduced in previous versions when Tex_ChangeEnvironments() was called with an argument. Will have to ask Mikolaj to be a bit more careful in adding new features... - More cleanup: Also changed some script local variables to function local variables... Should ask Mikolaj not to use script local variables unecessarily. They make the code very unreadable. I always keep wondering why this variable needs to be visible outside this function... - Code cleanup: g:Tex_PromptedEnvironmentsDefault and g:Tex_PromptedCommandsDefault moved from here to packages.vim, which is a more natural place for them. Index: envmacros.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/envmacros.vim,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** envmacros.vim 14 Jan 2003 23:56:52 -0000 1.24 --- envmacros.vim 15 Jan 2003 02:52:47 -0000 1.25 *************** *** 501,525 **** " Contributions / suggestions from Carl Mueller (auctex.vim) " ============================================================================== - " SetUpEnvironmentsPrompt: sets up a prompt string using g:Tex_PromptedEnvironments {{{ - " Description: - " - let g:Tex_PromptedEnvironmentsDefault = g:Tex_PromptedEnvironments - function! SetUpEnvironmentsPrompt() - let num_common = GetListCount(g:Tex_PromptedEnvironments) - - let i = 1 - let s:common_env_prompt = "\n" - - while i < num_common - - let env1 = Tex_Strntok(g:Tex_PromptedEnvironments, ',', i) - let env2 = Tex_Strntok(g:Tex_PromptedEnvironments, ',', i + 1) - - let s:common_env_prompt = s:common_env_prompt.'('.i.') '.env1."\t".( strlen(env1) < 4 ? "\t" : '' ).'('.(i+1).') '.env2."\n" - - let i = i + 2 - endwhile - let s:common_env_prompt = s:common_env_prompt.'Enter number or name of environment: ' - endfunction " }}} " PromptForEnvironment: prompts for an environment {{{ " Description: --- 501,504 ---- *************** *** 527,531 **** if !exists('s:common_env_prompt') ! call SetUpEnvironmentsPrompt() endif --- 506,513 ---- if !exists('s:common_env_prompt') ! let s:common_env_prompt = ! \ "\n" . ! \ Tex_CreatePrompt(g:Tex_PromptedEnvironments, 2, ',') . ! \ "Enter number or name of environment: " endif *************** *** 612,618 **** inoremap <silent> <Plug>Tex_FastEnvironmentInsert <C-r>=Tex_FastEnvironmentInsert("no")<cr> nnoremap <silent> <Plug>Tex_FastEnvironmentInsert i<C-r>=Tex_FastEnvironmentInsert("no")<cr> - inoremap <silent> <Plug>Tex_FastEnvironmentChange <C-O>:call Tex_ChangeEnvironments("no")<CR> - nnoremap <silent> <Plug>Tex_FastEnvironmentChange :call Tex_ChangeEnvironments("no")<CR> vnoremap <silent> <Plug>Tex_FastEnvironmentInsert <C-\><C-N>:call Tex_FastEnvironmentInsert("yes")<CR> " Tex_FastEnvironmentInsert: maps <F5> to prompt for env and insert it " {{{ --- 594,600 ---- inoremap <silent> <Plug>Tex_FastEnvironmentInsert <C-r>=Tex_FastEnvironmentInsert("no")<cr> nnoremap <silent> <Plug>Tex_FastEnvironmentInsert i<C-r>=Tex_FastEnvironmentInsert("no")<cr> vnoremap <silent> <Plug>Tex_FastEnvironmentInsert <C-\><C-N>:call Tex_FastEnvironmentInsert("yes")<CR> + inoremap <silent> <Plug>Tex_FastEnvironmentChange <C-O>:call Tex_ChangeEnvironments()<CR> + nnoremap <silent> <Plug>Tex_FastEnvironmentChange :call Tex_ChangeEnvironments()<CR> " Tex_FastEnvironmentInsert: maps <F5> to prompt for env and insert it " {{{ *************** *** 713,732 **** exe 'echomsg "You are within a '.env_name.' environment."' ! let s:change_env = PromptForEnvironment('Do you want to change it to (number or name)? ') ! if s:change_env == 'eqnarray' call <SID>Change('eqnarray', 1, '', 1) ! elseif s:change_env == 'eqnarray*' call <SID>Change('eqnarray*', 0, '\\nonumber', 0) ! elseif s:change_env == 'align' call <SID>Change('align', 1, '', 1) ! elseif s:change_env == 'align*' call <SID>Change('align*', 0, '\\nonumber', 0) ! elseif s:change_env == 'equation*' call <SID>Change('equation*', 0, '&\|\\lefteqn{\|\\nonumber\|\\\\', 0) ! elseif s:change_env == '' return 0 else ! call <SID>Change(s:change_env, 0, '', '') return 0 endif --- 695,714 ---- exe 'echomsg "You are within a '.env_name.' environment."' ! let change_env = PromptForEnvironment('What do you want to change it to? ') ! if change_env == 'eqnarray' call <SID>Change('eqnarray', 1, '', 1) ! elseif change_env == 'eqnarray*' call <SID>Change('eqnarray*', 0, '\\nonumber', 0) ! elseif change_env == 'align' call <SID>Change('align', 1, '', 1) ! elseif change_env == 'align*' call <SID>Change('align*', 0, '\\nonumber', 0) ! elseif change_env == 'equation*' call <SID>Change('equation*', 0, '&\|\\lefteqn{\|\\nonumber\|\\\\', 0) ! elseif change_env == '' return 0 else ! call <SID>Change(change_env, 0, '', '') return 0 endif *************** *** 818,822 **** if g:Tex_HotKeyMappings != '' ! " SetUpHotKeys: maps <F1> through <F4> to insert environments {{{ " Description: function! <SID>SetUpHotKeys() --- 800,804 ---- if g:Tex_HotKeyMappings != '' ! " SetUpHotKeys: maps <F1> through <F4> to insert environments " Description: function! <SID>SetUpHotKeys() *************** *** 832,836 **** endwhile ! endfunction " }}} endif --- 814,818 ---- endwhile ! endfunction endif *************** *** 866,903 **** " Implementation of Fast Environment commands for LaTeX commands " ============================================================================== - " SetUpCommandPrompt: sets up a prompt string using g:Tex_PromptedCommands {{{ - " Description: - " - - " This variable is default string for promting useful with updating new - " commands - let g:Tex_PromptedCommandsDefault = g:Tex_PromptedCommands - - function! SetUpCommandPrompt() - let num_common = GetListCount(g:Tex_PromptedCommands) - - let i = 1 - let s:common_com_prompt = "\n" - - while i < num_common - - let com1 = Tex_Strntok(g:Tex_PromptedCommands, ',', i) - let com2 = Tex_Strntok(g:Tex_PromptedCommands, ',', i + 1) - - let s:common_com_prompt = s:common_com_prompt.'('.i.') '.com1."\t".( strlen(com1) < 4 ? "\t" : '' ).'('.(i+1).') '.com2."\n" - - let i = i + 2 - endwhile - let s:common_com_prompt = s:common_com_prompt.'Enter number or name of command: ' - endfunction " }}} " PromptForCommand: prompts for a command {{{ " Description: function! PromptForCommand(ask) ! if !exists('s:common_com_prompt') ! call SetUpCommandPrompt() ! endif ! let inp = input(a:ask.s:common_com_prompt) if inp =~ '^[0-9]\+$' let com = Tex_Strntok(g:Tex_PromptedCommands, ',', inp) --- 848,860 ---- " Implementation of Fast Environment commands for LaTeX commands " ============================================================================== " PromptForCommand: prompts for a command {{{ " Description: function! PromptForCommand(ask) ! let common_com_prompt = ! \ Tex_CreatePrompt(g:Tex_PromptedCommands, 2, ',') . "\n" . ! \ "Enter number or command name :" ! let inp = input(a:ask."\n".common_com_prompt) if inp =~ '^[0-9]\+$' let com = Tex_Strntok(g:Tex_PromptedCommands, ',', inp) *************** *** 913,917 **** function! Tex_DoCommand(...) if a:0 < 1 ! let com = PromptForCommand('Choose which command to insert: ') if com != '' return Tex_PutCommand(com) --- 870,874 ---- function! Tex_DoCommand(...) if a:0 < 1 ! let com = PromptForCommand('Choose a command to insert: ') if com != '' return Tex_PutCommand(com) *************** *** 969,973 **** vnoremap <silent> <Plug>Tex_FastCommandInsert <C-\><C-N>:call Tex_FastCommandInsert('yes')<CR> ! " Tex_FastEnvironmentInsert: maps <F7> to prompt for command and insert it " {{{ " Description: " Here we are not solving if we are in preamble, behaviour is always the --- 926,930 ---- vnoremap <silent> <Plug>Tex_FastCommandInsert <C-\><C-N>:call Tex_FastCommandInsert('yes')<CR> ! " Tex_FastCommandInsert: maps <F7> to prompt for command and insert it " {{{ " Description: " Here we are not solving if we are in preamble, behaviour is always the *************** *** 985,989 **** " }}} ! " Tex_ChangeEnvironments: calls ChangeCommand() to change the environment {{{ " Description: " Finds out which environment the cursor is positioned in and changes --- 942,946 ---- " }}} ! " Tex_ChangeCommand: calls ChangeCommand() to change the environment {{{ " Description: " Finds out which environment the cursor is positioned in and changes *************** *** 994,998 **** function! Tex_ChangeCommand(isvisual) ! let s:pos_com = line('.').' | normal! '.virtcol('.').'|' let com_line = searchpair('\\\k\{-}{', '', '}', 'b') --- 951,955 ---- function! Tex_ChangeCommand(isvisual) ! let pos_com = line('.').' | normal! '.virtcol('.').'|' let com_line = searchpair('\\\k\{-}{', '', '}', 'b') *************** *** 1005,1018 **** if !exists('com_name') echomsg "You are not inside command" return 0 endif exe 'echomsg "You are within a '.com_name.' command."' ! let s:change_com = PromptForCommand('Do you want to change it to (number or name)? ') ! if s:change_com == '' return 0 else ! call <SID>ChangeCommand(s:change_com) return 0 endif --- 962,978 ---- if !exists('com_name') echomsg "You are not inside command" + exe pos_com return 0 endif exe 'echomsg "You are within a '.com_name.' command."' ! let change_com = PromptForCommand('Do you want to change it to (number or name)? ') ! if change_com == '' ! exe pos_com return 0 else ! call <SID>ChangeCommand(change_com) ! exe pos_com return 0 endif *************** *** 1020,1023 **** --- 980,984 ---- endfunction + " }}} " ChangeCommand: Changes current command according to prompt menu {{{ " Description: *************** *** 1026,1030 **** exe 'normal ct{'.a:newcom."\<Esc>" - exe s:pos_com endfunction --- 987,990 ---- *************** *** 1057,1061 **** " }}} - " }}} " this statement has to be at the end. let s:doneOnce = 1 --- 1017,1020 ---- |
From: Srinath A. <sr...@fa...> - 2003-01-15 01:13:01
|
On Tue, 14 Jan 2003, Mikolaj Machowski wrote: > On Tue, Jan 14, 2003 at 11:24:55AM -0800, Srinath Avadhanula wrote: > > Well, a quick overview of your changes to envmacros.vim reveals the > > following code: > > if !exists('s:common_com_prompt') > > call SetUpCommandPrompt() > > endif > > in PromptForCommand()... > > Which ofcourse means that s:common_com_prompt is initialized only once! > > But even commenting if construction behaviour is still the same... I was trying to debug this... Although I haven't debugged it, I am very curious why you use s: variables at various places in the code... For instance the s:Tex_LookForCommand is used only in Tex_pack_all(), so you should use just a function local variable (no prefix). Are you planning to use this later? Using s: variables makes code look very suspicious... Anyway, I'll release a new version now... Srinath |
From: <mi...@us...> - 2003-01-14 23:56:55
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv1990 Modified Files: envmacros.vim Log Message: - fixed bug ^[0-9][0-9]$ in .... - Removed "loose ends" for handling $...$ and \(...\) commands Index: envmacros.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/envmacros.vim,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** envmacros.vim 14 Jan 2003 13:40:44 -0000 1.23 --- envmacros.vim 14 Jan 2003 23:56:52 -0000 1.24 *************** *** 531,535 **** let inp = input(a:ask.s:common_env_prompt) ! if inp =~ '^[0-9][0-9]$' let env = Tex_Strntok(g:Tex_PromptedEnvironments, ',', inp) else --- 531,535 ---- let inp = input(a:ask.s:common_env_prompt) ! if inp =~ '^[0-9]\+$' let env = Tex_Strntok(g:Tex_PromptedEnvironments, ',', inp) else *************** *** 900,904 **** let inp = input(a:ask.s:common_com_prompt) ! if inp =~ '^[0-9][0-9]$' let com = Tex_Strntok(g:Tex_PromptedCommands, ',', inp) else --- 900,904 ---- let inp = input(a:ask.s:common_com_prompt) ! if inp =~ '^[0-9]\+$' let com = Tex_Strntok(g:Tex_PromptedCommands, ',', inp) else *************** *** 996,1008 **** let s:pos_com = line('.').' | normal! '.virtcol('.').'|' ! let com_line = searchpair('$\|\\(\|\\\k\{-}{', '', '$\|\\)\|}', 'b') if com_line != 0 ! if getline(com_line) !~ '\\\k\{-}{' ! let com_name = '$' ! else ! normal l ! let com_name = expand('<cword>') ! endif endif --- 996,1004 ---- let s:pos_com = line('.').' | normal! '.virtcol('.').'|' ! let com_line = searchpair('\\\k\{-}{', '', '}', 'b') if com_line != 0 ! normal l ! let com_name = expand('<cword>') endif *************** *** 1015,1023 **** let s:change_com = PromptForCommand('Do you want to change it to (number or name)? ') ! if s:change_com == '$' ! call <SID>ChangeCommand('$') ! elseif s:change_com == '\\(' ! call <SID>ChangeCommand('\\(') ! elseif s:change_com == '' return 0 else --- 1011,1015 ---- let s:change_com = PromptForCommand('Do you want to change it to (number or name)? ') ! if s:change_com == '' return 0 else *************** *** 1033,1046 **** function! s:ChangeCommand(newcom) ! " For now no special treatment form math commands, left loose ends for ! " future. ! if a:newcom == '$' ! return 0 ! elseif a:newcom == '\\(' ! return 0 ! else ! exe 'normal ct{'.a:newcom."\<Esc>" ! exe s:pos_com ! endif endfunction --- 1025,1030 ---- function! s:ChangeCommand(newcom) ! exe 'normal ct{'.a:newcom."\<Esc>" ! exe s:pos_com endfunction |
From: Mikolaj M. <mi...@wp...> - 2003-01-14 23:56:45
|
On Tue, Jan 14, 2003 at 11:24:55AM -0800, Srinath Avadhanula wrote: > Well, a quick overview of your changes to envmacros.vim reveals the > following code: > if !exists('s:common_com_prompt') > call SetUpCommandPrompt() > endif > in PromptForCommand()... > Which ofcourse means that s:common_com_prompt is initialized only once! But even commenting if construction behaviour is still the same... > Also, could you please verify that you have tested the new functionality > you have added? I am going to be fixing the "`g problem which was > recently reported and will make a release, but don't want to do it if > there are still bugs you know about... I tested it and don't know about more bugs. For sure I'll delete some "loose ends" for math commands. m. |
From: Mikolaj M. <mi...@wp...> - 2003-01-14 23:56:44
|
On Tue, Jan 14, 2003 at 10:42:08AM -0800, Srinath Avadhanula wrote: > > ! if inp =~ '^[0-9][0-9]$' > > let env = Tex_Strntok(g:Tex_PromptedEnvironments, ',', inp) > > else > Does this mean that if the user has to enter '09' or something similar to > say '9'. Dont have time to test but I am reasonably sure this creates a > bug. Shouldn't this be: > > ! if inp =~ '^[0-9]\+$' > ? Grrr. You're right... *sigh* Mikolaj |
From: Srinath A. <sr...@fa...> - 2003-01-14 23:51:36
|
I just realized that the Tex_pack_all is called only when latex-suite first starts up or when Tex_pack_updateall() is called. This will have to change if we need to support the scenario that the user opens 2 buffers one of which uses the german package and the other doesn't... We should maybe also utilize the fact that if the 2 buffers we have opened are in the same directory with the same .latexmain file then we don't need to call Tex_pack_updateall()... Srinath |
From: Srinath A. <sr...@fa...> - 2003-01-14 23:35:41
|
On Tue, 14 Jan 2003, Benji Fisher wrote: > OK, this will be simpler than what I had in mind. Better make > these variables buffer-local, then modify TexQuotes() to use the usual > buffer, global, default system. Remember, I may edit one German file, > then switch to English in another file in the same session. > > I will do this tomorrow if you do not beat me to it. > Please go ahead. This was just a prototype... Srinath |