You are not binding the variable dynamically. Edit: A sorry, I see now that you actually have declared the variable to be dynamically bound. But I am keeping the part of the answer which assumes otherwise anyway, as it might help others.
When lexical-binding
is set to t
, then let
, and other forms, bind variables lexically by default - that's what that setting does.
However let
can bind some variables lexically and others dynamically. What it should do for a particular variable, it figures out by checking whether the variable has been defined, or at least declared to be defined. So add this:
(defvar implicit-layout-active nil)
You most certainly also want to add a package prefix to that symbol and maybe add a doc-string explaining that the variable is only intended to be let-bound.
If you already have such a definition, but get the above error anyway, then that is probably because you use the variable before defining it. The order might also be wrong due to the use of outdated *.elc
files.
Instead of the above you have used:
(defvar implicit-layout-active)
I.e. you are declaring that the variable is defined, without actually making sure that there always is a binding. When you now evaluate some code which tries to get the value of the variable without it actually being bound dynamically, well then it is void.
haskell-indentation.el
, I'd say that the whole thing is flawed. The use of unprefixed dynamic variables is a major concern, and enablinglexical-scoping
for a file that's supposed to work with Emacs 23 (according to some comments) is another, the more since there are places where the module explicitly works around the lack of lexical binding—which leads the whole purposes oflexical-binding: t
ad absurdum.