1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Fix calling file name handler for `load'.

* lisp/net/ange-ftp.el (ange-ftp-load): Add MUST-SUFFIX argument.

* lisp/net/tramp.el (tramp-handle-load): Adapt MUST_SUFFIX test.

* src/lread.c (Fload): Call handler with must_suffix.

* test/lisp/net/tramp-tests.el (tramp-test27-load): Extend test.
This commit is contained in:
Michael Albinus 2022-11-04 15:39:58 +01:00
parent f0f960050b
commit 5d6e919a90
4 changed files with 14 additions and 15 deletions

View file

@ -4616,10 +4616,13 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(load tmp-name 'noerror 'nomessage))
(should-not (featurep 'tramp-test-load))
(write-region "(provide 'tramp-test-load)" nil tmp-name)
;; `load' in lread.c does not pass `must-suffix'. Why?
;;(should-error
;; (load tmp-name nil 'nomessage 'nosuffix 'must-suffix)
;; :type 'file-error)
;; `load' in lread.c passes `must-suffix' since Emacs 29.
;; In Ange-FTP, `must-suffix' is ignored.
(when (and (tramp--test-emacs29-p)
(not (tramp--test-ange-ftp-p)))
(should-error
(load tmp-name nil 'nomessage 'nosuffix 'must-suffix)
:type 'file-error))
(load tmp-name nil 'nomessage 'nosuffix)
(should (featurep 'tramp-test-load)))