Anton Lindqvist wrote:

> Hi,
> This patch add a autocmd event called TagNotFound triggered when the requested
> tag was not found. The motivation for this event is as follows: I usually add
> the following to my vimrc in order to ensure my tags file is up-to-date:
> 
>   au BufWritePost * if filereadable('tags') | silent exe '!ctags -a %' | endif
> 
> However this seems wasteful since the majority of my writes don't include new
> identifiers to be indexed. With this patch the command above could be replaced
> with:
> 
>   au TagNotFound * if filereadable('tags') | silent exe '!ctags' | endif
> 
> Thus indexing would only be performed when a missing tag is requested. 
> 
> Another use-case for this new event would be to trigger a psearch when the tag
> was not found:
> 
>   au TagNotFound * exe 'psearch /' . expand('<amatch>') . '/'

Thanks, it looks useful.  It still doesn't catch the case that a tag is
found but it's now in a different place.  I wonder if we can do
something more clever, only rebuild the tags file when one of the files
change AND using a tag command.  Might not be so easy.

> BTW: what's the recommended cinoptions for the Vim codebase?

Empty, that's my preference :-)

-- 
hundred-and-one symptoms of being an internet addict:
137. You decide to stay in college for an additional year or two,
     just so you can have the free Internet access.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui