Recently I was trapped by void-variable
error on eval-after-load
.
That is not first time I forget to quote args like:
(eval-after-load 'sql
'(progn
...))
because eval-after-load
docs say:
(eval-after-load FILE FORM)
I wrongly expect that FORM
is like BODY...
for example in when
:
(when COND BODY...)
What is the difference between FORM
and BODY
function call contract?
Why are there FORM
when BODY
is more convenient?
BODY
only for macros and FORM
only for functions?
Is (quote (progn ...))
usual way to make multi expression FORM
?
UPDATE Seems my guess is right about BODY
only for macros and FORM
only for functions:
(defmacro with-eval-after-load (file &rest body)
"Execute BODY after FILE is loaded.
FILE is normally a feature name, but it can also be a file name,
in case that file does not provide any feature."
(declare (indent 1) (debug t))
`(eval-after-load ,file (lambda () ,@body)))