summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/net/ange-ftp.el4
-rw-r--r--lisp/net/tramp.el11
2 files changed, 5 insertions, 10 deletions
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index 6ffa65a2dde..d6d0fb9a259 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -4242,7 +4242,7 @@ directory, so that Emacs will know its current contents."
((eq identification 'localname) localname)
(t (ange-ftp-replace-name-component file ""))))))
-(defun ange-ftp-load (file &optional noerror nomessage nosuffix)
+(defun ange-ftp-load (file &optional noerror nomessage nosuffix must-suffix)
(if (ange-ftp-ftp-name file)
(let ((tryfiles (if nosuffix
(list file)
@@ -4264,7 +4264,7 @@ directory, so that Emacs will know its current contents."
(or noerror
(signal 'file-error (list "Cannot open load file" file)))
nil))
- (ange-ftp-real-load file noerror nomessage nosuffix)))
+ (ange-ftp-real-load file noerror nomessage nosuffix must-suffix)))
;; Calculate default-unhandled-directory for a given ange-ftp buffer.
(defun ange-ftp-unhandled-file-name-directory (_filename)
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 9552e51c48d..b08bc63e8a2 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4584,14 +4584,9 @@ Do not set it manually, it is used buffer-local in `tramp-get-lock-pid'.")
(setq file (concat file ".elc")))
((file-exists-p (concat file ".el"))
(setq file (concat file ".el")))))
- (when must-suffix
- ;; The first condition is always true for absolute file names.
- ;; Included for safety's sake.
- (unless (or (file-name-directory file)
- (string-match-p (rx ".el" (? "c") eos) file))
- (tramp-error
- v 'file-error
- "File `%s' does not include a `.el' or `.elc' suffix" file)))
+ (when (and must-suffix (not (string-match-p (rx ".el" (? "c") eos) file)))
+ (tramp-error
+ v 'file-error "File `%s' does not include a `.el' or `.elc' suffix" file))
(unless (or noerror (file-exists-p file))
(tramp-error v 'file-missing file))
(if (not (file-exists-p file))