Mathias Michaelis wrote:
Tony, Andalou
If I do: gvim -u NONE -U NONE -c "set verbosefile=C:/vim.log"
I get: [...]
E329: No menu "&Buffer" [...]
I can confirm that behaviour of gvim, but I think it is a feature,
not a bug.
[...]
However, under ":help -u" it is said that "-u NONE" disables vimrc,
gvimrc, and all global plugins. If menu.vim was sourced nevertheless,
then IIUC the user must have somehow triggered that sourcing.
Since I can confirm that behaviour of gvim, I am "the user" :-) I
believe that nobody knows the Vim manual better than you, but after
seriously studying
:help startup
:help gui-init
I think that -u NONE prevents only the global plugin to be loaded,
but do not prevent the initialisation of the graphical user
interface, while -U NONE prevents the latter with one exception: The
system-wide menu files are sourced. If I verify this with
:help -U
,I come to the same conclusion. To prevent gvim from sourcing the
menu.vim script, call it like that:
gvim -u NONE -U NONE --cmd "set guioptions+=M" \
-c "set verbosefile=vim.log"
Indeed! Now the error messages within the vim.log file have
vanished! This is why I think that "the user" is innocent ;-)
Best regards
Mathias
You're saying that "no one" knows the Vim documentation better than I. I
have studied it assiduously (as, IMHO, any Vim user should do) but I am
by far not the oldest user of Vim on this list. I first knew Vim when
its latest release was 6.1, and there are people here who remember 5.7.
If someone knows the Vim docs better than anyone, I bet it's Bram
Moolenaar. ("Flatter not thy brother, it is treason; should thy brother
flatter thee, fear lest he should corrupt thee." How are you trying to
corrupt me? ;-) )
Under ":help -u" (at lines 431-434 of $VIMRUNTIME/doc/starting.txt for
Vim 7.0, last change 2006 Apr 25):
[...]
When {vimrc} is equal to "NONE" (all uppercase), all
initializations from files and environment variables are
skipped, including reading the |gvimrc| file when the GUI
starts. Loading plugins is also skipped.
[...]
IOW, -u NONE implies -U NONE
From what I found out answering another user, ":filetype on" (and its
variations) implicitly loads the menu structure. So if you issued a
":filetype [...] on" statement manually, that implicitly loaded the
menus (and issued the incriminated messages, which were intentionally
ignored except for verbose logging, when trying to delete a nonexistent
menu structure).
Otherwise, menu.vim is still sourced, as you noted, at GUI
inistialization time (see ":help -U" and ":help gui-init". The latter
has something which will probably be of interest to you (under ":help
buffers-menu"):
The system menu file includes a "Buffers" menu. If you don't want
this, set
the "no_buffers_menu" variable in your .vimrc (not .gvimrc!): >
:let no_buffers_menu = 1
< NOTE: Switching on syntax highlighting also loads the menu file, thus
disabling the Buffers menu must be done before ":syntax on".
...and, I would add, also before ":filetype on" or any of its variations.
Best regards,
Tony.