Take the following example macro, defined in macro.el.
(defmacro some-macro (&rest body)
`(let ((some-variable 1))
,@body))
And take the following function, defined in a different file, function.el.
(defun some-function ()
(some-macro (do-something)))
When function.el is byte-compiled, will some-variable be bound under lexical or dynamic binding?
I understand this depends on whether the file uses -*- lexical-binding: t; -*-, so my question specifically regards the following situations:
- If
function.eluses lexical binding, butmacro.eldoesn't. - If
macro.eluses lexical binding, butfunction.eldoesn't.
Does it make a difference if some-var has been declared global (with a defvar) inside function.el? If it does, I'm specifically interested in the case where it hasn't.