comparison lisp/ange-ftp.el @ 5840:e173b4b346e5

(ange-ftp-load): Honor the NOERROR and NOSUFFIX flags.
author Karl Heuer <kwzh@gnu.org>
date Mon, 07 Feb 1994 23:38:22 +0000
parents f193f880c524
children ec9477c8db1d
comparison
equal deleted inserted replaced
5839:14c24d764568 5840:e173b4b346e5
855 855
856 ;;;; ------------------------------------------------------------ 856 ;;;; ------------------------------------------------------------
857 ;;;; Internal variables. 857 ;;;; Internal variables.
858 ;;;; ------------------------------------------------------------ 858 ;;;; ------------------------------------------------------------
859 859
860 (defconst ange-ftp-version "$Revision: 1.39 $") 860 (defconst ange-ftp-version "$Revision: 1.40 $")
861 861
862 (defvar ange-ftp-data-buffer-name " *ftp data*" 862 (defvar ange-ftp-data-buffer-name " *ftp data*"
863 "Buffer name to hold directory listing data received from ftp process.") 863 "Buffer name to hold directory listing data received from ftp process.")
864 864
865 (defvar ange-ftp-netrc-modtime nil 865 (defvar ange-ftp-netrc-modtime nil
3639 (bin1 (ange-ftp-binary-file fn1))) 3639 (bin1 (ange-ftp-binary-file fn1)))
3640 (ange-ftp-copy-file-internal fn1 tmp1 t nil 3640 (ange-ftp-copy-file-internal fn1 tmp1 t nil
3641 (format "Getting %s" fn1)) 3641 (format "Getting %s" fn1))
3642 tmp1)))) 3642 tmp1))))
3643 3643
3644 (defun ange-ftp-load (file &rest args) 3644 (defun ange-ftp-load (file &optional noerror nomessage nosuffix)
3645 (if (ange-ftp-ftp-name file) 3645 (if (ange-ftp-ftp-name file)
3646 (let ((copy (ange-ftp-file-local-copy file))) 3646 (let ((tryfiles (if nosuffix
3647 (unwind-protect 3647 (list file)
3648 (apply 'load copy args) 3648 (list (concat file ".elc") (concat file ".el") file)))
3649 (delete-file copy))) 3649 copy)
3650 (apply 'ange-ftp-real-load file args))) 3650 (while (and tryfiles (not copy))
3651 (condition-case error
3652 (setq copy (ange-ftp-file-local-copy (car tryfiles)))
3653 (ftp-error nil)))
3654 (if copy
3655 (unwind-protect
3656 (funcall 'load copy noerror nomessage nosuffix)
3657 (delete-file copy))
3658 (or noerror
3659 (signal 'file-error (list "Cannot open load file" file)))))
3660 (ange-ftp-real-load file noerror nomessage nosuffix)))
3651 3661
3652 ;; Calculate default-unhandled-directory for a given ange-ftp buffer. 3662 ;; Calculate default-unhandled-directory for a given ange-ftp buffer.
3653 (defun ange-ftp-unhandled-file-name-directory (filename) 3663 (defun ange-ftp-unhandled-file-name-directory (filename)
3654 (file-name-directory ange-ftp-tmp-name-template)) 3664 (file-name-directory ange-ftp-tmp-name-template))
3655 3665