On 11/09/13 22:33, Charles Campbell wrote:
Hello!

I'm having a problem exemplified by the following code snippet: (lets
call this prblm.vim)

au BufEnter * sil! call Prblm(expand("<amatch>"))
fun! Prblm(fname)
   let g:junk= 1
   echomsg "TESTING<".a:fname.">"
endfun
vsplit


Use   vim -u NONE prblm.vim
:so %
:echo g:junk

At this point, we get E121 and E15.  Expected.

:mess

No messages other than the error messages from before.

:enew
:echo g:junk

Note that g:junk is now equal to 1.  OK so far...

:mess

The "TESTING..." message is missing, but since g:junk both exists and is
equal to 1, obviously the Prblm() function was called. (scientific linux
6.3; vim 7.4.25, huge).

Regards,
Chip Campbell


From a cscope "text" search of the Vim source:

E121: Undefined variable: %s
E15: Invalid expression: %s

These were for g:junk (undefined at the time of your first :echo command) weren't they?

I don't… Oh, wait! From ":help :silent":

"Normal messages will not be given or added to the message history. When [!] is added, error messages will also be skipped, and commands and mappings will not be aborted when an error is detected. |v:errmsg| is still set. When [!] is not used, an error message will cause further messages to be displayed normally."

:echomsg displays a "normal" message and adds it to command history… but that message is suppressed because of your ":silent" command.


Best regards,
Tony.
--
What do hookers do on their nights off, type?
                -- Elayn Boosler

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Raspunde prin e-mail lui