[Vim-latex-devel] Re: Incorporating new contributions into vim-latex
Brought to you by:
srinathava,
tmaas
From: Luc H. <her...@fr...> - 2002-11-10 04:16:07
|
* On Sat, Nov 09, 2002 at 05:08:49PM -0800, Srinath Avadhanula <sr...@fa...> wrote: > What about just adding them into the ftplugin/tex directory? If the script only concerns TeX, of course, this is a good way, may be the better. When it is broader than that, {rtp}/plugin or even {rtp}/macros will be better. Regarding dependencies aspects, if the script is not meant to be totally independant, forcing dependencies to be respected is not a very big issue -- as I guess it is not your main problem, I won't dwell any longer on this subject now. > This way vim will take care of sourcing them. This however means that > these plugins will have to be completely independent of latex-suite. I > still dont have a good way to get the commands into the menus? Also > some documentation is required. If on the long run everybody agrees to converge to one unique big and wonderful suite (I think it will be the case & I hope it will eventually happen), the issues will be: - for the add-on scripts: how to fit in the suite without messing up things - for the suite: how to export interface functions and commands (API) to the add-ons. For instance, I will take an example from lh-tex & my other html stuff: my suites are build around several commands: - MenuMake: that defines here a -nic-menu + 3 mappings for normal, insert and command mode to produce DVI documents :MenuMake nic 50.305 &LaTeX.Run\ LaTeX\ &once <C-L><C-O> \ <buffer> :wa<CR>:TeXMakeDVI 1<CR> - MapMenu: that defines a -inv-menu + 3 mappings for insert, normal and visual modes to insert TeX commands, here "\emph{}«»" [1](/ "emph{}" around current word/selection) :MapMenu 50.370.100.400 &LaTeX.&Fonts.S&hort\ Scope.&Emphasize \ ]em emph I haven't totaly checked the LaTeX suite, but with similar tools, the add-ons can easily fit in the suite. All the suite developers have to do is: propose the commands and suggest places (in menus) to add other stuff. A even more advanced (read "smart") mecanism could take care of the assignment of numbers in the menu -- could be tough to do, but interresting. Note BTW: this approach (MapMenu&MenuMake&...) ensures the mappings and menus are coherent. On this point it seems that mathmacros.vim and main.vim are not synchronized ; check the greek letters. Back to the point of beeing independant of the latex-suite. Today the agenda seems to be to bring together totally different features that can be defined in many different ways. The menu problem may arise. Eventually, the latex-suite will a be standard [2]. In other words, the latex-suite will be the big open IDE. Its role won't be to define menus for script to-be-written, but to propose API functions/commands that will be used by the script to-be-written in order to be part of the suite. Don't make an independant menus-for-(la)tex module. Instead, propose a way to define mappings *and* menu in one action, and split the different stuff according thematics: compilation/viewing, environments, maths, fonts (if not part of environments), smart chars, ... IMO, it will be easier to maintain and help on the scalability issue. Last point, try to not be redundant with other existing plugins. For instance you use a specialised version of mu-templates for LaTeX as an ftplugin. Why not using mu-template as a global plugin ? Copying it adds more work on your shoulders. And I don't see the point of having mu-templates for LaTeX, mu-templates for xslt, mu-templates for C++, etc. Don't make it a ftplugin. It is generic, like brackets and markers. Something like: function s:AddToMyMenu(template_file) let short=matchstr(a:template_file, \ 'template[/\\]tex[/\\]template\.\zs.*') exe "amenu ".g:Tex_TemplatesMenuLocation.".&".short." " \ ':MuTemplate tex/'.short."\<cr>" endfunction :command -nargs=1 AddToMyMenu :call s:AddToMyMenu("<arg>") :SearchInRuntime! AddToMyMenu template/tex/template.* " or, with your configuration and more complex regexs: :SearchInRuntime! \ AddToMyMenu template/template.tex-* \ AddToMyMenu template/tex/template.* \ AddToMyMenu ftplugin/latex-suite/templates/template.* :delcommand AddToMyMenu ... should do the trick [3] Hope this will be of any help. [1] "\emph{}" only if b:usemarks is set to 0 [2] Which make me think about auctex whose problem is "one monolotical file". It proposes many very good things, but it is (was?) not really scalable (neither European/French friendly): changing one little part to suit our preferences will be eventually problematic for the day a new version is available. [3] but: - with a customized version of mu-template that is not aware of latex, vim, C++, xslt, etc, - and another plugin (searchInRuntime). -- Luc Hermitte |