Bill McCarthy wrote:
Hello Vim List,

I wrote a command to perform :helpgrep on just the
distribution help files.  My first pass was:

    command! -nargs=1 HG sil RTPtemp
        \ | exe 'helpg <args>'
        \ | sil RTPrestore

RTPtemp and RTPrestore are commands taking no args (they are
defined below my sig).

To get this to work, I had to enclose 'sil RTPtemp' in an
'exe':

    command! -nargs=1 HG exe 'sil RTPtemp'
        \ | exe 'helpg <args>'
        \ | sil RTPrestore

Why?


RTPtemp is defined without -bar. Therefore

  :sil RTPtemp | exe 'helpg <args>' | sil RTPrestore

is invalid.

But if it were defined with -bar, the whole text would be seen as argument of the first ":silent". You need ":exe" to terminate the first ":silent" before ":exe 'helpg <args>'".


Best regards,
Tony.

Reply via email to