On Fri, May 07, 2010 at 04:17:36PM +0200, Bram Moolenaar wrote: > > Edward L. Fox wrote: > > > Here's a small patch provided by Liang Peng, alias Bezetek James. He > > has fixed the problem in menu/unmenu/emenu series commands. > > > > As my understanding, "emenu" is designed for scripts to access some > > menu items. However, "emenu" only accepts the localized menu names. > > For example, you can use your script to add a new menu item by calling > > "amenu File.Test :echo 'hello'<CR>", but you can't execute the same > > menu item by calling "emenu File.Test" if you are not running Vim in > > English mode. Instead, you have to use localized menu name for > > "File". However, we don't have any interface to access the menu > > translation table via script. So "emenu" command is nearly useless > > for script writers. > > > > Bezetek's patch makes menu/unmenu/emenu useful again. He modified the > > menu structure to store the original strings before the localization, > > and accepts the unlocalized strings for all the menu series commands > > when calling all menu related command. To keep the compatibility, > > localized menu names are also accepted, just like the behavior before. > > > > This is his first patch to Vim, and he's quite eager to participate in > > open source projects. Please help review his patch and include it in > > the next release of Vim. Many thanks! > > This is very useful. > > There was an old patch that I never got around looking into, from Bjorn > Winckler. It dates 2008 March 30. > > http://www.mail-archive.com/vim_dev@googlegroups.com/msg02561.html > > Perhaps you can compare the patches and find out what works best?
I reviewed both of them. The patch from Bjorn only fixed the emenu problem. Liang's patch actually did much more, for example, it also adjust the wild menu for all menu related commands as well. Moreover, he slightly modified the structure of menu.c to make the code a little bit more readable, which was also suggested by Bjorn in his post. I think his patch is already in very good quality, and is almost ready to be included. Can anyone else also help with a more strict review? > -- > How To Keep A Healthy Level Of Insanity: > 3. Every time someone asks you to do something, ask if they want fries > with that. > > /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ > /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ > \\\ download, build and distribute -- http://www.A-A-P.org /// > \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- 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