1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 22:41:06 -08:00

; * lisp/files.el (require-with-check): Fix doc string and error text.

This commit is contained in:
Eli Zaretskii 2024-08-12 21:38:46 +03:00
parent 6d55e94996
commit b585826a65

View file

@ -1258,11 +1258,11 @@ See `load-file' for a different interface to `load'."
(defun require-with-check (feature &optional filename noerror) (defun require-with-check (feature &optional filename noerror)
"If FEATURE is not already loaded, load it from FILENAME. "If FEATURE is not already loaded, load it from FILENAME.
This is like `require' except if FEATURE is already a member of the list This is like `require' except if FEATURE is already a member of the list
`features, then we check if this was provided by a different file than the `features, then check if it was provided by a different file than the
one that we would load now (presumably because `load-path' has been one that is about to be loaded now (presumably because `load-path' has
changed since the file was loaded). been changed since FILENAME was loaded). If that is the case, either
If it's the case, we either signal an error (the default), or forcibly reload signal an error (the default), or forcibly reload the new file (if
the new file (if NOERROR is equal to `reload'), or otherwise emit a warning." NOERROR is equal to `reload'), or otherwise emit a warning."
(let ((lh load-history) (let ((lh load-history)
(res (require feature filename (if (eq noerror 'reload) nil noerror)))) (res (require feature filename (if (eq noerror 'reload) nil noerror))))
;; If the `feature' was not yet provided, `require' just loaded the right ;; If the `feature' was not yet provided, `require' just loaded the right
@ -1275,7 +1275,7 @@ the new file (if NOERROR is equal to `reload'), or otherwise emit a warning."
((assoc fn load-history) nil) ;We loaded the right file. ((assoc fn load-history) nil) ;We loaded the right file.
((eq noerror 'reload) (load fn nil 'nomessage)) ((eq noerror 'reload) (load fn nil 'nomessage))
(t (funcall (if noerror #'warn #'error) (t (funcall (if noerror #'warn #'error)
"Feature provided by other file: %S" feature))))) "Feature `%S' is now provided by a different file %s" fn)))))
res)) res))
(defun file-remote-p (file &optional identification connected) (defun file-remote-p (file &optional identification connected)