Ensure buffer local variable is not cleared by mode change.
Merge pull request #927 from greywolve/patch-1

[Fix #924] Ensure buffer local variable is not cleared by mode change.