On Sun 30-Jul-06 3:13pm -0600, A.J.Mechelynck wrote:

> Autocommands for a common event are executed in the order they were
> defined; so if they are defined by their respective plugins, they will
> be executed in the same order the plugins were sourced. Try (if you
> didn't yet) moving the AsNeeded plugin to the plugin subdir of a
> directory listed later in 'runtimepath' than where taglist sits, e.g.
> taglist in $HOME/vimfiles/plugin and AsNeeded in $VIM/vimfiles/plugin
> (typically C:\Program Files\vim\vimfiles\plugin ).

I moved AsNeeded from vimfiles\plugin to vimfiles.

    :au FuncUndefined

only shows the taglist autocmds as expected.

    :ru AsNeeded.vim
    :au FuncUndefined

now shows the AsNeeded autocmd at the bottom.

    :TlistSessionLoad filename

gives the same error.

I have found a way to let these two useful tools work
together:

    Move AsNeeded.vim out of the plugin directory (keeping
    taglist.vim there).

    In .vimrc,

        :ru plugin\taglist.vim
        :ru AsNeeded.vim

This performs the second load of taglist before AsNeeded's
autocmd is defined.

So far, taglist and AsNeeded are working fine together.

> Then again, maybe AsNeeded should allow for the possibility that other
> plugins might hook the FuncUndefined event?

Perhaps only needed is for any function that resolves a
FuncUndefined action should set a global variable with the
name of the function resolved.  When such a function is
triggered, it could check that global.

I made an interesting discovery.  If I force AsNeeded to
load after taglist (its first time), although I get the same
error message running :TlistSessionLoad, the session was
indeed loaded.

What is happening is the autocmd for taglist was triggered
and did its thing.  Then the autocmd from AsNeeded was
triggered and failed.  Typing:

    :Tlist

worked fine.

-- 
Best regards,
Bill

Reply via email to