| 142 | The following code can used to create Project entries in a buffer. Note that various settings will be altered by the call to DoSetup so it's probably best to use a new buffer. |
| 143 | |
| 144 | {{{ |
| 145 | function! GetProjectSNR() |
| 146 | if exists(":Project") |
| 147 | let a_sav = @a |
| 148 | redir @a |
| 149 | exec "silent function" |
| 150 | redir END |
| 151 | let funclist = @a |
| 152 | let @a = a_sav |
| 153 | let func = split(split(matchstr(funclist,'.SNR.\{-}GenerateEntry'),'\n')[-1])[1] |
| 154 | return matchlist(func, '\(.*\)G')[1] |
| 155 | endif |
| 156 | endfunction |
| 157 | |
| 158 | function! Test() |
| 159 | let SNR = GetProjectSNR() |
| 160 | call {SNR}DoSetup() |
| 161 | call {SNR}DoEntryFromDir(0, line("."), 'test', 'c:\temp', 'c:\temp', '', '', '*', 0, 0) |
| 162 | return '' |
| 163 | endfunction |
| 164 | }}} |
| 165 | |
| 166 | Grabbing the SNR isn't pretty but seems to work and prevents having to recreate the work done in Project. |
| 167 | |