[doc][patch] explanation of "s" char to :help showing-menus

15 views
Skip to first unread message

Tom M

unread,
Mar 16, 2020, 3:46:50 PM3/16/20
to vim...@googlegroups.com
Hi,

:menu listing sometimes contains items with an "s" in the first column. Here is an example which can be seen after sourcing the standard menu.vim:
:menu Edit.Select\ All
--- Menus ---
400 &Select All^IggVG
    n&s  :<C-U>call <SNR>11_SelectAll()<CR>
    v&s  :<C-U>call <SNR>11_SelectAll()<CR>
    s&s  :<C-U>call <SNR>11_SelectAll()<CR>
    o&s  :<C-U>call <SNR>11_SelectAll()<CR>
The thing is I can't seem to find an explanation for the "s" in the docs. Neither in gui.txt nor elsewhere. But according to the code in show_menus_recursive() in menu.c, "s" means a menu defined with "<silent>". So I suggest the following patch to add that info to the :help showing-menus section:

*** ../vim-8.2.0385/runtime/doc/gui.txt	2020-02-26 16:15:31.060386992 +0100
--- runtime/doc/gui.txt	2020-03-16 16:33:44.019652866 +0100
***************
*** 855,860 ****
--- 855,862 ----
  * The menu was defined with "nore" to disallow remapping.
  & The menu was defined with "<script>" to allow remapping script-local
  mappings only.
+ * The menu was defined with "<silent>" to avoid showing what it is
+ mapped to when triggered.
  - The menu was disabled.
 
  Note that hitting <Tab> while entering a menu name after a menu command may

Happy Vimming!

Tom M

Bram Moolenaar

unread,
Mar 16, 2020, 4:09:24 PM3/16/20
to vim...@googlegroups.com, Tom M

Tom M wrote:

> :menu listing sometimes contains items with an "s" in the first column.
> Here is an example which can be seen after sourcing the standard menu.vim:
>
> :menu Edit.Select\ All--- Menus ---
> 400 &Select All^IggVG
> n&s :<C-U>call <SNR>11_SelectAll()<CR>
> v&s :<C-U>call <SNR>11_SelectAll()<CR>
> s&s :<C-U>call <SNR>11_SelectAll()<CR>
> o&s :<C-U>call <SNR>11_SelectAll()<CR>
>
> The thing is I can't seem to find an explanation for the "s" in the docs.
> Neither in gui.txt nor elsewhere. But according to the code in
> show_menus_recursive() in menu.c, "s" means a menu defined with "<silent>".
> So I suggest the following patch to add that info to the :help showing-menus
> section:
>
> *** ../vim-8.2.0385/runtime/doc/gui.txt 2020-02-26 16:15:31.060386992 +0100
> --- runtime/doc/gui.txt 2020-03-16 16:33:44.019652866 +0100
> ***************
> *** 855,860 ****
> --- 855,862 ----
> * The menu was defined with "nore" to disallow remapping.
> & The menu was defined with "<script>" to allow remapping script-local
> mappings only.
> + * The menu was defined with "<silent>" to avoid showing what it is
> + mapped to when triggered.
> - The menu was disabled.
>
> Note that hitting <Tab> while entering a menu name after a menu command may
>

That "*" should be "s" then. I'll include that.

--
A cow comes flying over the battlements, lowing aggressively. The cow
lands on GALAHAD'S PAGE, squashing him completely.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Tom M

unread,
Mar 16, 2020, 5:23:27 PM3/16/20
to Bram Moolenaar, vim...@googlegroups.com
> That "*" should be "s" then. I'll include that.

Yes. Sure. This is a copy-paste error where I would expect some
21st-century-AI-check to automatically kick in. ;-)

Tom M
Reply all
Reply to author
Forward
0 new messages