* lisp/eshell/esh-var.el (eshell-handle-local-variables): Simplify, and move leading-nil handling to... * lisp/eshell/esh-cmd.el (eshell-named-command): ... here. * test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/skip-leading-nils): * test/lisp/eshell/esh-var-tests.el (esh-var-test/local-variables/skip-nil): New tests. * doc/misc/eshell.texi (Expansion): Document this behavior.