[PATCH] Make 'lispwords' a global-local option

81 views
Skip to first unread message

guns

unread,
Feb 16, 2014, 5:44:19 AM2/16/14
to vim...@googlegroups.com
Hello,

Currently the 'lispwords' setting is global, yet three filetypes attempt
to change it on filetype/indent load: scheme, clojure, and art.

Scheme and Clojure, in particular, are two very different Lisp variants,
but both modify 'lispwords' to influence their indenting. Both filetypes
also call `setlocal lispwords<` in undo hooks to unset the local value
of the setting, but of course, this does not work.

The following attached patches make the 'lispwords' setting global-local
to allow different Lisps to use this setting concurrently:

[PATCH 1/3]
Changes the scope of 'lispwords'.

[PATCH 2/3]
Adds a simple test, appended to test100 (hope that's okay; it was
the only existing test that obviously involved global-local scope).

[PATCH 3/3]
Corrects a bug in the Clojure runtime files regarding its handling
of 'lispwords'.

Also moves the 'lispwords' setting from the indent script to the
ftplugin script to mirror the Scheme filetype.

I do not foresee any backwards compatibility issues in these changes,
especially since the only two scripts that reference 'lispwords'
evidently assume that the option is already global-local.

Cheers,
Sung Pae
0001-Make-lispwords-a-global-local-option.patch
0002-Add-test-for-lispwords-global-local-scope.patch
0003-Change-lispwords-in-Clojure-filetype-for-new-global-.patch

Bram Moolenaar

unread,
Feb 16, 2014, 10:55:51 AM2/16/14
to guns, vim...@googlegroups.com
Thanks, I'll add it in the todo list.

--
Proverb: A nightingale that forgets the lyrics is a hummingbird.

/// 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 ///

Sergey Khorev

unread,
Feb 24, 2014, 11:12:20 AM2/24/14
to vim...@googlegroups.com, guns
Currently the 'lispwords' setting is global, yet three filetypes attempt
to change it on filetype/indent load: scheme, clojure, and art.

Scheme and Clojure, in particular, are two very different Lisp variants,
but both modify 'lispwords' to influence their indenting. Both filetypes
also call `setlocal lispwords<` in undo hooks to unset the local value
of the setting, but of course, this does not work.

The following attached patches make the 'lispwords' setting global-local
to allow different Lisps to use this setting concurrently:



Sounds like a nice idea. I always wondered why lispwords is global :) 
Reply all
Reply to author
Forward
0 new messages