On Fri, Jan 06, 2012 at 05:33:01AM -0800, Ben Fritz wrote: > > > On Jan 6, 4:21 am, Adrien "Axioplase" Piérard <axioplase > [email protected]> wrote: > > Hello, > > > > As a scheme and common lisp programmer, I have started using a very > > nice plugin recently, namely "slimv" > > (http://www.vim.org/scripts/script.php?script_id=2531). > > It currently has an issue which seems to be rooted in vim's defaut > > configuration : whenever a scheme file is loaded, the slimv's lisp > > related ftplugins are all executed as well and wreak havoc. > > > > ... > > > > Even though this may have been convenient, I believe that this is a > > bug and should be fixed accordingly, by separating scheme and lisp in > > the distribution of vim. > >
I believe that the inclusion of the runtime! directive within
ftplugin/scheme.vim is inappropriate, and should be reconsidered.
However, the greater error is that ftplugin/scheme.vim does not
contain the traditional
if exists("b:did_ftplugin")
finish
endif
stanza, and its omission does not allow the user to prevent the
loading of the extra lisp scripts through the intervention of their
own ~/.vim/ftplugin/scheme.vim.
> Scheme IS Lisp.
>
> http://en.wikipedia.org/wiki/Scheme_(programming_language) says,
> "Scheme is one of the two main dialects of the programming language
> Lisp."
I don't disagree with this statement in light of Scheme's pedigree,
but from a text-editor point of view this conflation is not helpful.
I don't know how familiar you are with Lisp and Scheme, so don't think
that I'm trying to sound at all patronizing. Some of Scheme's
primitive functions share names with Common Lisp's, and the syntax of
both are S-Expressions, but these are merely superficial similarities.
I contend that Scheme has diverged enough from Lisp to be considered a
language in its own right. You may as well insist that all
Algol-descended imperative languages which use curly-braces to denote
blocks also source ftplugin/c.vim.
> It should be completely possible for the plugin author to set some
> global or buffer-local variable to indicate which language is actually
> being used (or maybe just check the 'filetype' option) and act
> accordingly. This is a plugin bug, not a Vim bug.
To be clear, there is currently no acceptable way for a Scheme
programmer to avoid loading the Lisp filetype plugins.
Even if I remain in the minority in my belief that Scheme and Lisp are
different languages, we can at the very least modify the
distribution's scheme filetype plugin to allow the user to completely
override it.
Here's the patch to do that:
diff -r 3ee9e0ab0413 runtime/ftplugin/scheme.vim
--- a/runtime/ftplugin/scheme.vim Wed Jan 04 20:29:22 2012 +0100
+++ b/runtime/ftplugin/scheme.vim Fri Jan 06 11:12:47 2012 -0700
@@ -4,7 +4,12 @@
" URL: http://iamphet.nm.ru/vim
" Original author: Dorai Sitaram <[email protected]>
" Original URL:
http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html
-" Last Change: Nov 22, 2004
+" Last Change: Jan 06, 2012
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
runtime! ftplugin/lisp.vim ftplugin/lisp_*.vim ftplugin/lisp/*.vim
Regards,
Erik
--
Erik Falor
Registered Linux User #445632 http://counter.li.org
pgpKzd3aw8zcu.pgp
Description: PGP signature
