GNU bug report logs -
#72915
Docstrings of add-hook and remove-hook improvement?
Previous Next
Reported by: Tomas Nordin <tomasn <at> posteo.net>
Date: Sat, 31 Aug 2024 12:38:01 UTC
Severity: normal
Tags: patch
Fixed in version 30.1
Done: Stefan Kangas <stefankangas <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 72915 <at> debbugs.gnu.org (full text, mbox):
Tomas Nordin <tomasn <at> posteo.net> writes:
> diff --git a/lisp/subr.el b/lisp/subr.el
> index 28ba30f584e..e60c4119c60 100644
> --- a/lisp/subr.el
> +++ b/lisp/subr.el
> @@ -2090,6 +2090,10 @@ add-hook
> "Add to the value of HOOK the function FUNCTION.
> FUNCTION is not added if already present.
>
> +HOOK should be a symbol. If HOOK is void, or if HOOK's value is a
> +single function, it is changed to a list of functions (containing only
> +FUNCTION in the void case).
> +
> The place where the function is added depends on the DEPTH
> parameter. DEPTH defaults to 0. By convention, it should be
> a number between -100 and 100 where 100 means that the function
> @@ -2108,10 +2112,6 @@ add-hook
> buffer-local value. That acts as a flag to run the hook
> functions of the global value as well as in the local value.
>
> -HOOK should be a symbol. If HOOK is void, it is first set to
> -nil. If HOOK's value is a single function, it is changed to a
> -list of functions.
> -
> FUNCTION may be any valid function, but it's recommended to use a
> function symbol and not a lambda form. Using a symbol will
> ensure that the function is not re-added if the function is
> @@ -2179,7 +2179,7 @@ remove-hook
> "Remove from the value of HOOK the function FUNCTION.
> HOOK should be a symbol, and FUNCTION may be any valid function. If
> FUNCTION isn't the value of HOOK, or, if FUNCTION doesn't appear in the
> -list of hooks to run in HOOK, then nothing is done. See `add-hook'.
> +list of functions to run in HOOK, then nothing is done. See `add-hook'.
>
> The optional third argument, LOCAL, if non-nil, says to modify
> the hook's buffer-local value rather than its default value.
LGTM.
This bug report was last modified 79 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.