The byte-compiler does not currently seem to recognise that a function has been defined when using
defun within a
let expression under
lexical-binding, as explained in Stefan's answer to this question.
In my own initialisation file, I have found that I can make the
let obvious to the byte-compiler by wrapping the whole form in
eval-and-compile, as I noted under the same question.
My multipart question is:
- What further effects (desirable or otherwise) does placing the
eval-and-compilehave compared to the bare version w.r.t. interpretation/byte-compilation/macroexpansion, etc.
- I roughly understand by looking at the definition of
defunthat it is a glorified wrapper around
defalias. Apart from forgoing the explicit
(lambda () ...)(or other function value) which needs to be passed to
defalias, is there some other subtle difference between
defun, e.g. different treatment by the byte-compiler?