Weasley wrote:

> use redir in functions, e.g.
> func! Func1()
>     redir => funclist
>     silent func
>     redir END
>     " .... other sentence ...
> 
> endfunc
> 
> funclist maybe a local-variable, but it is globle variable here, must
> write
> redir => l:funclist
> to make funclist a local variable.
> 
> the doc only said:
> :redi[r] => {var}     Redirect messages to a variable.  If the variable
>                       doesn't exist, then it is created.  If the variable
>                       exists, then it is initialized to an empty string.
>                       The variable will remain empty until redirection ends.
>                       Only string variables can be used.  After the
>                       redirection starts, if the variable is removed or
>                       locked or the variable type is changed, then further
>                       command output messages will cause errors. {not in Vi}

It should write to the local variable.  I can change that, but it might
break some existing scripts.

It would be easier to change the documentation, but the behavior would
be quite unexpected.

-- 
hundred-and-one symptoms of being an internet addict:
211. Your husband leaves you...taking the computer with him and you
     call him crying, and beg him to bring the computer back.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

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

Raspunde prin e-mail lui