Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 179356 - ftplugin/ada.vim problem with vim-7.1
Summary: ftplugin/ada.vim problem with vim-7.1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Vim Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-21 20:15 UTC by George Shapovalov (RETIRED)
Modified: 2011-03-02 08:28 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
vim-7.1-ada-default-compiler.patch (vim-7.1-ada-default-compiler.patch,543 bytes, patch)
2008-04-05 19:08 UTC, Ali Polatel (RETIRED)
Details | Diff
vim-7.1-ada-mapleader.patch (vim-7.1-ada-mapleader.patch,1.00 KB, patch)
2008-04-05 19:10 UTC, Ali Polatel (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description George Shapovalov (RETIRED) gentoo-dev 2007-05-21 20:15:08 UTC
After upgrading to vim-7.1 annoying complaints pop up before the actual file is open. Looks like the supplied ftplugin/ada.vim file cannot be digested by the new version. The screen-fool of messages goes like that:

"mlib-tgt.ads" [readonly] 279L, 12431C
Error detected while processing /usr/share/vim/vim71/ftplugin/ada.vim:
line  111:
E121: Undefined variable: g:ada_default_compiler
E15: Invalid expression: "compiler " . g:ada_default_compiler
Error detected while processing function ada#Map_Popup:
line    1:
E121: Undefined variable: g:mapleader
E116: Invalid arguments for function escape(g:mapleader . "a" . a:Keys , '\') . " :"^I  . a:Command . "<CR>"
E15: Invalid expression: "50amenu " . "PopUp."   . escape(a:Text, ' ') . "<Tab>"^I  . escape(g:mapleader . "a"
 . a:Keys , '\') . " :"^I  . a:Command . "<CR>"
Error detected while processing function ada#Map_Popup..ada#Map_Menu:
line   26:
[...]

Way to reproduce:
touch test.adb
vim (or view) test.adb

If this file (ada.vim) is "masked" (by, e.g., renaming) the complaints go away (not sure what this file was supposed to do actually).

George
Comment 1 Mike Kelly (RETIRED) gentoo-dev 2007-05-31 04:32:23 UTC
This is a bug in the ftplugin/ada.vim script provided by upstream, so I'm going to close this bug as UPSTREAM.

If you could report this bug to the upstream vim maintainers, I'm sure they'll come up with a good fix. Here's their instructions for submitting a bug report (taken from their FAQ):

2.6. Where can I report bugs?

First collect the required information using the following command:

    :source $VIMRUNTIME/bugreport.vim

Now send the resulting text from the above command to the bugs@vim.org
e-mail address.

The Vim Development mailing list (see above) is a good place to discuss
general bugs.  If the bug you find is with syntax highlighting or some
other "added feature" (i.e. not directly programmed into vim), attempt to
inform the maintainer of that feature.

For more information, read

    :help bug-reports

When a patch is made to fix this, we'll make a new gentoo release of vim.
Comment 2 George Shapovalov (RETIRED) gentoo-dev 2007-06-14 11:56:20 UTC
Hi Mike.

I checked with the upstream. Now apparently we are supposed to set at least two vars in .vimrc to make the plugin not complain and work properly:
  let   g:ada_default_compiler        = 'gnat'
  let   g:mapleader                   = "<F12>"

Adding them indeed works.

I am not sure what is the best way to deal with this - whether to add these options to the default vimrc or to produce a warning. First is probably better, as the warning is not that useful for majority of users and setting ada_default_compiler to "gnat" should be fine in foreseeable future (we don't have any other Ada compilers in the tree so far and that is the only free compiler anyway). That is the settings are pretty static.

George
Comment 3 Ali Polatel (RETIRED) gentoo-dev 2008-04-05 19:08:21 UTC
Created attachment 148776 [details, diff]
vim-7.1-ada-default-compiler.patch
Comment 4 Ali Polatel (RETIRED) gentoo-dev 2008-04-05 19:10:21 UTC
Created attachment 148778 [details, diff]
vim-7.1-ada-mapleader.patch

Here are two patches for the problems you've described. The first one checks if the variable g:ada_default_compiler exists before using it and the second one uses 
<LocalLeader> instead of g:mapleader which is the appropriate usage here.
Can you please test these and see if they work fine?
(apply the patches in /usr/share/vim/vim71)
I'll submit them upstream but I want them to be tested by someone who knows ada first :)
Comment 5 Tupone Alfredo gentoo-dev 2008-06-13 09:59:03 UTC
Why not adding a further change to put in vimrc the default ada compiler?
Comment 6 Tim Harder gentoo-dev 2011-03-02 08:28:58 UTC
This appears to be fixed in current versions. Closing as fixed.