Woah, emacs lisp now has lexical scoping
http://www.gnu.org/software/emacs/manual/html_node/elisp/Usi...
from http://www.gnu.org/software/emacs/manual/html_node/elisp/Lex... -
Such code is also much more friendly to concurrency, which we want to add to Emacs in the near future.
Exciting times ahead ...
To enable it per-file use a file-local variable:
;;; -*- lexical-binding: t -*-Or as Perl did it (18 years ago) with a new keyword, so that you can use both dynamic and lexical variables in the same file? Best of both worlds.