On Thu, Feb 08, 2007 at 11:56:21AM +0100, A.J.Mechelynck wrote: > Marc Weber wrote: > >Do I have missed a non quoting version of <f-args> ? > > > >Consider this example: > > > > > >function! T(...) > > for a in a:000 > > echom 'arg:'.string(a) > > endfor > >endfunction > > > >------ 8< ------ 8< start test.vim < ------ 8< ------ 8< ------ 8< > > > > command! -nargs=* -buffer TestAddSeven :call T(7,<f-args>) > > command! -nargs=* -buffer Test2 :exec "call > > T(7,".join([<f-args>],',').')' > > TestAddSeven 4 'abc' > > echo "Test 2" > > Test2 3 'abc' > > > >------ >8 ------ >8 end >8 ------ >8 ------ >8 ------ >8 ------ >8 > > > > > >------ >8 ------ >8 output ------ >8 ------ >8 ------ >8 ------ >8 > > arg:7 > > arg:'4' << here you can see that all arguments get extra > > extra quotes > > arg:'''abc''' > > Test 2 > > arg:7 > > arg:3 > > arg:'abc' > >------ 8< ------ 8< ------ 8< ------ 8< ------ 8< ------ 8< ------ 8< > > > >So is there a non quoting version of <f-args> which behaves like the > >join([<f-args>],', ') part? > > > >Marc > > > > Here are the various ways in which a user-command may pass arguments: > > :command arg1 arg2 arg3 arg4 arg5 > <args> passes > arg1 arg2 arg3 arg4 arg5 > <q-args> passes > "arg1 arg2 arg3 arg4 arg5" > <f-args> passes > "arg1","arg2","arg3","arg4","arg5" >
I did my mistake here: :command 'arg1 arg2' <f-args> will pass '''arg1' 'arg2''' , not 'arg1 arg2' So <f-args> works the way you'd expect but I have to pass the values without quotes which don't bother vim here in no way.. Marc