*** ange-ftp.el.dist Sat Feb 14 16:03:26 1998 --- ange-ftp.el Sat Feb 14 21:46:07 1998 *************** *** 460,465 **** --- 460,481 ---- ;;; to fix its files hashtable. A cookie to anyone who can think of a ;;; fast, sure-fire way to recognize ULTRIX over ftp. + ;;; FTP service port support: + ;;; + ;;; 1. Filename syntax. + ;;; normal syntax and "/loginname@hostname:port:filepath". + ;;; + ;;; 2. Add variables. + ;;; ange-ftp-name-format + ;;; + ;;; 3. Modify functions. + ;;; ange-ftp-ftp-name + ;;; ange-ftp-replace-name-component + ;;; ange-ftp-normal-login + ;;; + ;;; Feb 14 1998 + ;;; Hisashi Gotoh + ;;; If you find any bugs or problems with this package, PLEASE either e-mail ;;; the above author, or send a message to the ange-ftp-lovers mailing list ;;; below. Ideas and constructive comments are especially welcome. *************** *** 618,624 **** ;;;; ------------------------------------------------------------ (defvar ange-ftp-name-format ! '("^/\\(\\([^@/:]*\\)@\\)?\\([^@/:]*\\):\\(.*\\)" . (3 2 4)) "*Format of a fully expanded remote file name. This is a list of the form \(REGEXP HOST USER NAME\), where REGEXP is a regular expression matching --- 634,640 ---- ;;;; ------------------------------------------------------------ (defvar ange-ftp-name-format ! '("^/\\(\\([^/:]*\\)@\\)?\\([^@/:]*\\)\\(:\\([^@/:]+\\)\\)?:\\(.*\\)" . (3 5 2 6)) "*Format of a fully expanded remote file name. This is a list of the form \(REGEXP HOST USER NAME\), where REGEXP is a regular expression matching *************** *** 679,684 **** --- 695,703 ---- (defvar ange-ftp-disable-netrc-security-check nil "*If non-nil avoid checking permissions on the .netrc file.") + (defvar ange-ftp-default-port "21" + "*Default FTP service port number for \`ange-ftp-normal-login\'.") + (defvar ange-ftp-default-user nil "*User name to use when none is specied in a file name. If nil, then the name under which the user is logged in is used. *************** *** 1285,1294 **** (if (string-match (car ange-ftp-name-format) name) (let* ((ns (cdr ange-ftp-name-format)) (host (ange-ftp-ftp-name-component 0 ns name)) ! (user (ange-ftp-ftp-name-component 1 ns name)) ! (name (ange-ftp-ftp-name-component 2 ns name))) (if (zerop (length user)) (setq user (ange-ftp-get-user host))) (list host user name)) nil))))) --- 1304,1317 ---- (if (string-match (car ange-ftp-name-format) name) (let* ((ns (cdr ange-ftp-name-format)) (host (ange-ftp-ftp-name-component 0 ns name)) ! (port (ange-ftp-ftp-name-component 1 ns name)) ! (user (ange-ftp-ftp-name-component 2 ns name)) ! (name (ange-ftp-ftp-name-component 3 ns name))) (if (zerop (length user)) (setq user (ange-ftp-get-user host))) + (if (zerop (length port)) + (setq ange-ftp-current-port ange-ftp-default-port) + (setq ange-ftp-current-port port)) (list host user name)) nil))))) *************** *** 1298,1304 **** (ange-ftp-save-match-data (if (string-match (car ange-ftp-name-format) fullname) (let* ((ns (cdr ange-ftp-name-format)) ! (elt (nth 2 ns))) (concat (substring fullname 0 (match-beginning elt)) name (substring fullname (match-end elt))))))) --- 1321,1327 ---- (ange-ftp-save-match-data (if (string-match (car ange-ftp-name-format) fullname) (let* ((ns (cdr ange-ftp-name-format)) ! (elt (nth 3 ns))) (concat (substring fullname 0 (match-beginning elt)) name (substring fullname (match-end elt))))))) *************** *** 1862,1868 **** PROC is the process to the FTP-client." (let ((result (ange-ftp-raw-send-cmd proc ! (format "open %s" (ange-ftp-nslookup-host host)) (format "Opening FTP connection to %s" host)))) (or (car result) (ange-ftp-error host user --- 1885,1891 ---- PROC is the process to the FTP-client." (let ((result (ange-ftp-raw-send-cmd proc ! (format "open %s %s" (ange-ftp-nslookup-host host) ange-ftp-current-port) (format "Opening FTP connection to %s" host)))) (or (car result) (ange-ftp-error host user