Improve documentation of 'require-with-check'

* doc/lispref/loading.texi (Named Features): Document
'require-with-check'.

* etc/NEWS: Fix wording of entry about 'require-with-check'.
This commit is contained in:
Eli Zaretskii 2023-12-29 21:19:50 +02:00
parent d7ff14fcba
commit 291763feca
2 changed files with 17 additions and 0 deletions

View file

@ -1011,6 +1011,19 @@ If loading the file succeeds but does not provide @var{feature},
@code{require} signals an error about the missing feature.
@end defun
@defun require-with-check feature &optional filename noerror
This function works like @code{require}, except if @var{feature} is
already loaded (i.e.@: is already a member of the list in
@code{features}, see below). If @var{feature} is already loaded, this
function checks if @var{feature} was provided by a file different from
@var{filename}, and if so, it by default signals an error. If the
value of the optional argument @var{noerror} is @code{reload}, the
function doesn't signal an error, but instead forcibly reloads
@var{filename}; if @var{noerror} is some other non-@code{nil} value,
the function emits a warning about @var{feature} being already
provided by another file.
@end defun
@defun featurep feature &optional subfeature
This function returns @code{t} if @var{feature} has been provided in
the current Emacs session (i.e., if @var{feature} is a member of

View file

@ -1361,7 +1361,11 @@ values.
* Lisp Changes in Emacs 30.1
+++
** New function 'require-with-check' to detect new versions shadowing.
This is like 'require', but it checks whether the argument 'feature'
is already loaded, in which case it either signals an error or
forcibly reloads the file that defines the feature.
+++
** New 'pop-up-frames' action alist entry for 'display-buffer'.