* A.J.Mechelynck <[EMAIL PROTECTED]> [060723 22:23]:
> Bram: 'exe "silent <command>"' apparently does not give the same
> result as ':silent exe <command>' (see example below). Bug or feature?
> 
>       gvim -N -u NONE
>       :version
> 
> VIM - Vi IMproved 7.0 (2006 May 7, compiled Jul 23 2006 22:50:51)
> Included patches: 1-42
> Compiled by [EMAIL PROTECTED]
> Huge version with GTK2-GNOME GUI.  Features included (+) or not (-):
> [...]
> 
> 
> Conclusion: It's ":silent exe blahblah", not ":exe 'silent' blahblah".
> Note that about half a screen below ":help :silent" there is an
> example with ":silent exe normal".
> 

I see no difference between ":silent exe blahblah" and ":exe silent blahblah".
But I did determine the trigger; see below.

BTW, I did recompile with patches 1-42 after my last message; the later
patches did not appear to have any effect on my problem.

> 
> Note: While doing those tests, I found that if the current buffer is
> modified, the function will give an error at line 2. You may want to
> add
> 
>       let save_hidden = &hidden
>       set hidden
> 
> at the start of the function, and
> 
>       let &hidden = save_hidden

Thanks, I'll add that (I think; see below).  I have 'set hidden' in my
.vimrc, but this is a script for public consumption, so I don't want to
rely on my own settings!

> 
> before returning. OTOH I don't quite understand why you must search an
> auxiliary buffer rather than the current one being edited.
> 
> 
> Best regards,
> Tony.

The cause of the problem is ":set hidden".  I tried gvim -N -u NONE and
did not see the problem, so I tried gvim (with my normal .vimrc and the
rest of the system-wide configuration) and did see the problem.  My
first thought was autocmds, so I started deleting blocks of autocmds.
But, even after deleting all autocmds I still had the problem.  A more
careful examination of the list from ':set' showed hidden as one of the
differences.  When I tried gvim -N -u NONE, then :set hidden, the
problem returned.

Note that once you :set hidden, the problem remains until you not only
:set nohidden, but also switch buffers at least once.

Bram, is this intentional (or more importantly, can it be changed so
that the message is displayed in the right order or at least obeys
':silent')?

Tony, thanks very much for your help!

...Marvin

Reply via email to