Hello,

Meikel Brandmeyer <[EMAIL PROTECTED]> wrote:
> > Which doesn't help us, script maintainers to reload a plugin.
> > Well, to be honest, it not really a problem as we can always comment
> > the finish line (as long as we don't forget to restore it later).
> > However, now my plugins checks a exists("g:force_reload_{plugin}") in
> > the first test.
> I disagree. Obviously instead of modifying your plugin*s*, you would
> just have to add the force flag to the central Guard function and *all*
> your scripts support your flag immediately.

Well, if gatekeeper could also propose a way to force reloading (multiple times)
a plugin, that would be nice.


> > Moreover, all my headers are generated with a template-files expander
> > that provides the adequate anti-reinclusion guards for plugins (1
> > global guard), ftplugins (1 global + 1 local guards), local_vimrcs
> > (1local + 1 global), or whatever other vim script (0 guard).

> This sound like a very special setup. It is hard (if not futile) to try
> to cover all cases. What's of course possible, is to replace the central
> Guard function. So there also some flexibility into this direction.
> This is limited by the public API of course...

It is not that special at all. ftplugins are very close to plugins except that:
- they require a local guard
- sometimes they can need a global guard, for global definitions which can be
moved to autoload plugins now.

> > What is hidden in this last sentence, is that gatekeeper does not
> > help with ftplugins. When the ftplugin is just one file, blocking it
> > is easy. When it is a suite made of many plugins, and ftplugins,
> > blocking it with one assignment in the .vimrc becomes a much more
> > complex task, and the call cannot even be used as an anti-reinclusion
> > guard (see for instance LaTeX-Suite (or my C&C++ suite, which I don't
> > distributed in any distribution before a very long time)).
> Hmm.. This is another point, which needs some thought. I didn't think
> about multi-file scripts.


BTW, did you read David "2 cents" about storing the version of a plugin in its
anti-reinclusion guard ?

This is a good practice that, I think, should indeed be generalized -- and I
have a lot of work to do on this one. This is something the Guard function from
Gatekeeper should take into account (may be with an optional parameter receiving
the current version of the script?) At terms, it could help to implement
dependency checks when a particular version of another script is required.

-- 
Luc Hermitte
http://lh-vim.googlecode.com/
http://hermitte.free.fr/vim/

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui