Merge from origin/emacs-30

6f5c322f59 Recommend secure-hash in md5 docstring
1352b184f3 Improve docstring of add-hook and remove-hook
This commit is contained in:
Eli Zaretskii 2025-03-01 10:01:53 -05:00
commit a242d9a48f
2 changed files with 13 additions and 8 deletions

View file

@ -2145,6 +2145,9 @@ instead; it will indirectly limit the specpdl stack size as well.")
"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.
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
@ -2163,10 +2166,6 @@ This makes the hook buffer-local, and it makes t a member of the
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
@ -2231,10 +2230,11 @@ performance impact when running `add-hook' and `remove-hook'."
(set-default hook hook-value))))
(defun remove-hook (hook function &optional local)
"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'.
"Remove FUNCTION from HOOK's functions.
HOOK should be a symbol, and FUNCTION may be any valid function.
Do nothing if HOOK does not currently contain FUNCTION.
Compare functions with `equal`, which means that it can be
slow if FUNCTION is not a symbol. 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.

View file

@ -6320,6 +6320,11 @@ command `prefer-coding-system') is used.
If NOERROR is non-nil, silently assume the `raw-text' coding if the
guesswork fails. Normally, an error is signaled in such case.
This function is semi-obsolete, since for most purposes it is equivalent
to calling `secure-hash` with the symbol `md5' as the ALGORITHM
argument. The OBJECT, START and END arguments have the same meanings as
in `secure-hash'.
Note that MD5 is not collision resistant and should not be used for
anything security-related. See `secure-hash' for alternatives. */)
(Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object noerror)