Re: DocView AutoFitting via "doc-view-autofit-mode"
Hm, I seem to have expressed myself a bit poorly,
so let me clear it up:
> Obviously, named functions are used all over the place with
> lexical-binding, so they do work in many circumstances.
I know that and what I wrote was not meant to contradict it, because
you write about general, I wrote about inside lexical-binding enabled files
where lexical-let and let should be the same (since lexical binding is
already
enabled).
> using
> `lexical-let' inside a lexical binding enabled file produces tons of
> "bad lexing"
> errors when used with named functions
To clarify, I wrote nothing about `lexical-let' in general, I wrote that
using it
inside a lexical binding enabled file (meaning with the
"lexical-binding: t" header)
together with a named function would produce errors.
You can try it out for yourself with the code I send in the same mail
you refer to:
> ;;; foo.el --- Foo -*- lexical-binding: t -*-
>
> (defun foo (window)
> (message "%s" window))
>
> (defun bar ()
> (interactive)
> (lexical-let ((foobar (selected-window)))
> (foo foobar)))
Switch to an empty buffer, paste it and then do `M-x eval-buffer' `M-x bar'
and you'll get a [bad-lexical-ref] error.
Remove the header ( the ;;; foo.el line), do `M-x eval-buffer' `M-x bar'
again and you won't get an error, but a message with the selected window.
If you use a lambda inside the defun of bar instead of foo, it will work
with and without
lexical-binding enabled. And this difference is what I simply don't
understand.
Now, since I had no idea why the function `lexical-let' would behave
differently
(if it didn't there should be either an error with AND without the
header, or
both should work fine), could not find any clues in info/manual/docstring
and more, why it doesn't work, I wrote that.
Moritz