*** ange-ftp.el.orig Tue Jul 30 01:26:55 1996 --- ange-ftp.el Thu Dec 24 18:54:26 1998 *************** *** 469,474 **** --- 469,490 ---- ;; 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. *************** *** 627,633 **** ;;;; ------------------------------------------------------------ (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 --- 643,649 ---- ;;;; ------------------------------------------------------------ (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 *************** *** 689,694 **** --- 705,713 ---- (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 specified in a file name. If non-nil but not a string, you are prompted for the name. *************** *** 1309,1318 **** (if (posix-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))))) --- 1328,1341 ---- (if (posix-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))))) *************** *** 1322,1328 **** (save-match-data (if (posix-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))))))) --- 1345,1351 ---- (save-match-data (if (posix-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))))))) *************** *** 1880,1888 **** host specified in ``ange-ftp-gateway-host''." (let ((result (ange-ftp-raw-send-cmd proc ! (format "open %s %s" (ange-ftp-nslookup-host ange-ftp-gateway-host) ! ange-ftp-smart-gateway-port) (format "Opening FTP connection to %s via %s" host ange-ftp-gateway-host)))) --- 1903,1911 ---- host specified in ``ange-ftp-gateway-host''." (let ((result (ange-ftp-raw-send-cmd proc ! (format "open %s 10021" (ange-ftp-nslookup-host ange-ftp-gateway-host) ! ange-ftp-current-port) (format "Opening FTP connection to %s via %s" host ange-ftp-gateway-host)))) *************** *** 1912,1918 **** (let* ((nshost (ange-ftp-nslookup-host host)) (result (ange-ftp-raw-send-cmd proc ! (format "open %s" nshost) (format "Opening FTP connection to %s" host)))) (or (car result) (ange-ftp-error host user --- 1935,1941 ---- (let* ((nshost (ange-ftp-nslookup-host host)) (result (ange-ftp-raw-send-cmd proc ! (format "open %s %s" nshost ange-ftp-current-port) (format "Opening FTP connection to %s" host)))) (or (car result) (ange-ftp-error host user