From: Pip Cet Date: Thu, 15 Aug 2024 16:28:07 +0000 (+0000) Subject: * lisp/files.el (require-with-check): Improve error messages. X-Git-Tag: archive/raspbian/1%30.1+1-3+rpi1^2~2^2~20^2~558 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=45a78ec6c57ab7d88846a143f81087d5575d0422;p=emacs.git * lisp/files.el (require-with-check): Improve error messages. --- diff --git a/lisp/files.el b/lisp/files.el index eadb4a9d0b1..6cbb1b5c632 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1274,9 +1274,17 @@ NOERROR is equal to `reload'), or otherwise emit a warning." (cond ((assoc fn load-history) nil) ;We loaded the right file. ((eq noerror 'reload) (load fn nil 'nomessage)) - (t (funcall (if noerror #'warn #'error) - "Feature `%S' is now provided by a different file %s" - feature fn))))) + ((and fn (memq feature features)) + (funcall (if noerror #'warn #'error) + "Feature `%S' is now provided by a different file %s" + feature fn)) + (fn + (funcall (if noerror #'warn #'error) + "Could not load file %s" fn)) + (t + (funcall (if noerror #'warn #'error) + "Could not locate file %s in load path" + (or filename (symbol-name feature))))))) res)) (defun file-remote-p (file &optional identification connected)