Your second patch seems to work fine, but the problem in my original
mapping and function remained. I finally found and fixed the
problem, but I don't understand what's going on.
This test mapping and function (from the original problem report)
now works fine when I move the cursor over a word and type "viwgx".
vmap <silent> gx :call DebugSilent()<CR>
function DebugSilent()
echomsg "from DebugSilent"
endfunction
But if I add this :normal command to the function, the message
disappears.
function DebugSilent()
normal gvy
echomsg "from DebugSilent"
endfunction
If I add :silent in front of the :normal command, the message
persists again as desired.
function DebugSilent()
silent normal gvy
echomsg "from DebugSilent"
endfunction
I don't understand why the :normal command affects a message echoed
_after_ the :normal command.
Regards,
Gary