Stefan Monnier <monnier@iro.umontreal.ca> schrieb am Mon Feb 23 2015 at 23:32:20:
>> Another problem is that defvar may simply never be called.
> But isn't it a bug to run-hooks a variable that was never explicitly
> defined?

All hook functions have always treated "unbound" as equal to nil, so no,
it's not considered a bug to run a hook that's still unbound.

Basically, given that "unbound == nil", what is a bug is to defvar
a hook with a non-nil default value, unless that hook is predefined
(i.e. is never unbound).


Is this something the byte compiler could warn about? At least normal hooks by convention end in "-hook", so a warning could be emitted every time such a variable is defined that doesn't have nil as default.