Subject: bug#72915: Docstrings of add-hook and remove-hook improvement?

From: Tomas Nordin <[email-masked]>
Date: Sun, 01 Sep 2024 15:47:36 +0000

Stefan Kangas <[email-masked]> writes:

> Stefan Kangas <[email-masked]> writes:
>
>> The wording in the manual is probably all that is needed here:
>>
>>     This function removes FUNCTION from the hook variable HOOK.
>
> BTW.  Here's another idea:
>
>     If HOOK is a list of functions, remove FUNCTION from that list.
>
>     If HOOK is equal to FUNCTION, set HOOK to nil.
>
>     Otherwise do nothing.

I like that, adjusted maybe to respect Stefan M's nitpick:

If HOOK's value is a list of functions, remove FUNCTION from that list.
If HOOK's value is FUNCTION, set HOOK to nil.
Otherwise do nothing.