Friday, November 7, 2014

Re: Problem with Red Hat's Vim 7.0.237 and SpellCheck.vim

Hi Gary!

On Do, 06 Nov 2014, Gary Johnson wrote:

> At work, my home directory resides on a file server and is
> auto-mounted to whatever machine I log on to. One of the servers I
> occasionally log on to is running Red Hat Enterprise Linux Server
> release 5 and another is running CentOS release 5.11. Vim on both
> is:
>
> VIM - Vi IMproved 7.0 (2006 May 7, compiled Jan 8 2013 23:55:00)
> Included patches: 1, 3-4, 7-9, 11, 13-17, 19-26, 29-31, 34-44, 47, 50-56, 58-64, 66-73, 75, 77-92, 94-107, 109, 202, 234-237
> Modified by <bugzilla@redhat.com>
> Compiled by <bugzilla@redhat.com>
> Huge version without GUI. Features included (+) or not (-):
>
> When I start vim on either machine, I get the following error
> messages.
>
> Error detected while processing /home/garyjohn/.vim/plugin/SpellCheck.vim:
> line 37:
> E700: Unknown function: SpellCheck#AutoEnableSpell
> line 40:
> E700: Unknown function: SpellCheck#SpellAddWrapper
>
> Here is the relevant portion of that plugin (revision 1.21.007).
>
> 28 " Avoid installing twice or when in unsupported Vim version.
> 29 if exists('g:loaded_SpellCheck') || (v:version < 700)
> 30 finish
> 31 endif
> 32 let g:loaded_SpellCheck = 1
> 33
> 34 "- configuration ---------------------------------------------------------------
> 35
> 36 if ! exists('g:SpellCheck_OnNospell')
> 37 let g:SpellCheck_OnNospell = function('SpellCheck#AutoEnableSpell')
> 38 endif
> 39 if ! exists('g:SpellCheck_OnSpellAdd')
> 40 let g:SpellCheck_OnSpellAdd = function('SpellCheck#SpellAddWrapper')
> 41 endif
>
> I would like to put some test in my ~/.vimrc that would determine
> whether this plugin could be successfully loaded and set
> g:loaded_SpellCheck if not, but I don't know what that test should
> be. Testing for Vim version 7.0 or greater is not sufficient.
> $VIMRUNTIME/autoload exists and I don't get errors from other
> plugins that use autoloaded functions. I'd like to use something
> more reliable and general than to just test for those particular
> servers or those particular OSs.
>
> Thoughts?

I would simply wrap the function() call in a try catch clause and on
error abort/finish.

Best,
Christian
--
In der Schule gab's für mich Höhen und Tiefen. Die Höhen waren der
Fußball.
-- Thomas Häßler

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment