Subject: Re: bug#21311: 25.0.50; non-defvared hooks are not declared special with lexical-binding

From: Tassilo Horn <[email-masked]>
Date: Fri, 21 Aug 2015 17:40:32 +0200

Stefan Monnier <[email-masked]> writes:

>> It seems that hooks that are not declared using defvar but come into
>> being just because of a (add-hook 'my-hook ...) are not declared as
>> special meaning you cannot let-bind them to change their value in the
>> dynamic scope of the let.
>
> Yes.
>
>> The bug disappears as soon as I
>>   - don't use lexical-binding, or
>>   - defvar the hook (Fix #1 or #2)
>
> I think either of fix #1 or #2 are proper fixes and I think there's not
> much more we can do about it.

Allright.

> Arguably, nowadays packages should defvar all their hooks.

Ok, then I'll issue a bug report for magit.  That's the package whose
non-defvared hook I wanted to let-bind.

Bye,
Tassilo