Commit 1a7ffe17 authored by Karl Heuer's avatar Karl Heuer
Browse files

(ange-ftp-load): Honor the NOERROR and NOSUFFIX flags.

parent e4f794ed
...@@ -857,7 +857,7 @@ SIZE, if supplied, should be a prime number." ...@@ -857,7 +857,7 @@ SIZE, if supplied, should be a prime number."
;;;; Internal variables. ;;;; Internal variables.
;;;; ------------------------------------------------------------ ;;;; ------------------------------------------------------------
(defconst ange-ftp-version "$Revision: 1.39 $") (defconst ange-ftp-version "$Revision: 1.40 $")
(defvar ange-ftp-data-buffer-name " *ftp data*" (defvar ange-ftp-data-buffer-name " *ftp data*"
"Buffer name to hold directory listing data received from ftp process.") "Buffer name to hold directory listing data received from ftp process.")
...@@ -3641,13 +3641,23 @@ system TYPE.") ...@@ -3641,13 +3641,23 @@ system TYPE.")
(format "Getting %s" fn1)) (format "Getting %s" fn1))
tmp1)))) tmp1))))
(defun ange-ftp-load (file &rest args) (defun ange-ftp-load (file &optional noerror nomessage nosuffix)
(if (ange-ftp-ftp-name file) (if (ange-ftp-ftp-name file)
(let ((copy (ange-ftp-file-local-copy file))) (let ((tryfiles (if nosuffix
(unwind-protect (list file)
(apply 'load copy args) (list (concat file ".elc") (concat file ".el") file)))
(delete-file copy))) copy)
(apply 'ange-ftp-real-load file args))) (while (and tryfiles (not copy))
(condition-case error
(setq copy (ange-ftp-file-local-copy (car tryfiles)))
(ftp-error nil)))
(if copy
(unwind-protect
(funcall 'load copy noerror nomessage nosuffix)
(delete-file copy))
(or noerror
(signal 'file-error (list "Cannot open load file" file)))))
(ange-ftp-real-load file noerror nomessage nosuffix)))
;; Calculate default-unhandled-directory for a given ange-ftp buffer. ;; Calculate default-unhandled-directory for a given ange-ftp buffer.
(defun ange-ftp-unhandled-file-name-directory (filename) (defun ange-ftp-unhandled-file-name-directory (filename)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment