Closed d11wtq closed 10 years ago
EDIT | Apologies, I can't get GitHub's Markdown parser to render the code blocks in the list.
On closer inspection, it looks like lispwords
is being clobbered. Vim recognizes syntax
as 'scheme' or 'clojure', but set lispwords?
shows me only the Clojure special forms even in a Scheme buffer.
Interestingly, the opposite doesn't seem to be true when I open the Scheme buffer first.
:set lispwords?
lispwords=defun,define,defmacro,set!,lambda,if,case,let,flet,let*,letrec,do,do*,define-syntax,let-syntax,letrec-s
yntax,destructuring-bind,defpackage,defparameter,defstruct,deftype,defvar,do-all-symbols,do-external-symbols,do-sym
bols,dolist,dotimes,ecase,etypecase,eval-when,labels,macrolet,multiple-value-bind,multiple-value-call,multiple-valu
e-prog1,multiple-value-setq,prog1,progv,typecase,unless,unwind-protect,when,with-input-from-string,with-open-file,w
ith-open-stream,with-output-to-string,with-package-iterator,define-condition,handler-bind,handler-case,restart-bind
,restart-case,with-simple-restart,store-value,use-value,muffle-warning,abort,continue,with-slots,with-slots*,with-a
ccessors,with-accessors*,defclass,defmethod,print-unreadable-object
:set lispwords?
lispwords=bound-fn,def,definline,definterface,defmacro,defmethod,defmulti,defn,defn-,defonce,defprotocol,defrecor
d,defstruct,deftest,deftest-,deftype,extend,extend-protocol,extend-type,fn,ns,proxy,reify,set-test,as->,binding,doa
ll,dorun,doseq,dotimes,doto,for,if-let,let,letfn,locking,loop,testing,when-first,when-let,with-bindings,with-in-str
,with-local-vars,with-open,with-precision,with-redefs,with-redefs-fn,with-test,case,cond->,cond->>,condp,if,if-not,
when,when-not,while,catch
:set lispwords?`
lispwords=bound-fn,def,definline,definterface,defmacro,defmethod,defmulti,defn,defn-,defonce,defprotocol,defrecor
d,defstruct,deftest,deftest-,deftype,extend,extend-protocol,extend-type,fn,ns,proxy,reify,set-test,as->,binding,doa
ll,dorun,doseq,dotimes,doto,for,if-let,let,letfn,locking,loop,testing,when-first,when-let,with-bindings,with-in-str
,with-local-vars,with-open,with-precision,with-redefs,with-redefs-fn,with-test,case,cond->,cond->>,condp,if,if-not,
when,when-not,while,catch
It looks like vim-clojure-static clobbered the lispwords setting. Missing a setlocal
, perhaps?
Hello, thanks for reporting!
It looks like vim-clojure-static clobbered the lispwords setting. Missing a setlocal, perhaps?
It seems the problem is actually that lispwords
is a global setting when it should really be a global-local setting.
Only three filetypes ever touch lispwords
: clojure
, art
, and scheme
. The scheme ftplugin, unlike the other two, only appends extra words onto lispwords
if g:is_mzscheme
or g:is_chicken
is true. (Try repeating your experiment after setting one of these options; ugh)
All three scripts also register a reset-to-default setlocal lispwords<
in the ftplugin/indent undo hooks, but this does not actually work because lispwords is global, not global-local.
I'd like to send a patch upstream for this rather than attempt to hack around it here. I will post a link to the mailing list thread here when it happens.
Thank you! I was not aware of the existence of global vs global-local variables. I'll be able to hack around it for now anyway :)
Okay, I've sent patches upstream:
https://groups.google.com/forum/#!topic/vim_dev/6Abi8nsY2Dc
Let's hope they approve.
Awesome, kudos! :)
Bram merged the 'lispwords'
patch as 7.4.201:
https://groups.google.com/forum/#!topic/vim_dev/AXWalJt-RNQ
Could you please confirm that this patch/version addresses this issue?
Oh, excellent. I'll fire up a docker container and install Vim from mercurial later to try it out :)
Just tested it now. Works a treat, thanks heaps for sorting it out!
Great, thanks for reporting/
I'm not sure if this is a bug in vim-clojure-static, Vim itself, or something else. In a freshly opened Vim (7.3), if I open a Scheme file before anything else, I get the correct indentation for Scheme code. If I then switch to a Clojure buffer, nothing is indented correctly; as if it still thinks I'm editing Scheme (e.g. the
(:require ... )
forms in a(ns ... )
are indented aligned with the namespace name, instead of under the 's'.Likewise, if the first buffer I open is a Clojure buffer, my Clojure code is indented correctly, but when I switch to a Scheme buffer, it refuses to indent correctly (e.g. the body of a
(define (x y z) ... )
form indents in line with the parameter list.