Mercurial > emacs
comparison lisp/ange-ftp.el @ 1233:e795fe80b14e
Doc fix.
author | Christopher Zaborsky <rogue@erratum.com> |
---|---|
date | Sun, 27 Sep 1992 17:22:08 +0000 |
parents | 69fc2c96e27e |
children | 82774f4b69dd |
comparison
equal
deleted
inserted
replaced
1232:2c56a159c9b6 | 1233:e795fe80b14e |
---|---|
847 (defun ange-ftp-hash-entry-exists-p (key tbl) | 847 (defun ange-ftp-hash-entry-exists-p (key tbl) |
848 "Return whether there is an association for KEY in TABLE." | 848 "Return whether there is an association for KEY in TABLE." |
849 (intern-soft (ange-ftp-make-hash-key key) tbl)) | 849 (intern-soft (ange-ftp-make-hash-key key) tbl)) |
850 | 850 |
851 (defun ange-ftp-hash-table-keys (tbl) | 851 (defun ange-ftp-hash-table-keys (tbl) |
852 "Return a sorted list of all the active keys in the hashtable, as strings." | 852 "Return a sorted list of all the active keys in TABLE, as strings." |
853 (sort (all-completions "" tbl) | 853 (sort (all-completions "" tbl) |
854 (function string-lessp))) | 854 (function string-lessp))) |
855 | 855 |
856 ;;;; ------------------------------------------------------------ | 856 ;;;; ------------------------------------------------------------ |
857 ;;;; Internal variables. | 857 ;;;; Internal variables. |
858 ;;;; ------------------------------------------------------------ | 858 ;;;; ------------------------------------------------------------ |
859 | 859 |
860 (defconst ange-ftp-version "$Revision: 4.20 $") | 860 (defconst ange-ftp-version "$Revision: 1.6 $") |
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 |
1129 ;;;; ------------------------------------------------------------ | 1129 ;;;; ------------------------------------------------------------ |
1130 ;;;; ~/.netrc support | 1130 ;;;; ~/.netrc support |
1131 ;;;; ------------------------------------------------------------ | 1131 ;;;; ------------------------------------------------------------ |
1132 | 1132 |
1133 (defun ange-ftp-chase-symlinks (file) | 1133 (defun ange-ftp-chase-symlinks (file) |
1134 "Return the filename that FILENAME references, following all symbolic links." | 1134 "Return the filename that FILE references, following all symbolic links." |
1135 (let (temp) | 1135 (let (temp) |
1136 (while (setq temp (ange-ftp-real-file-symlink-p file)) | 1136 (while (setq temp (ange-ftp-real-file-symlink-p file)) |
1137 (setq file | 1137 (setq file |
1138 (if (file-name-absolute-p temp) | 1138 (if (file-name-absolute-p temp) |
1139 temp | 1139 temp |
1192 (and account | 1192 (and account |
1193 (setq ange-ftp-default-account account))))) | 1193 (setq ange-ftp-default-account account))))) |
1194 (goto-char end))) | 1194 (goto-char end))) |
1195 | 1195 |
1196 (defun ange-ftp-parse-netrc () | 1196 (defun ange-ftp-parse-netrc () |
1197 "If ~/.netrc file exists and has the correct permissions then extract the | 1197 "Read in ~/.netrc, if one exists. |
1198 If ~/.netrc file exists and has the correct permissions then extract the | |
1198 \`machine\', \`login\', \`password\' and \`account\' information from within." | 1199 \`machine\', \`login\', \`password\' and \`account\' information from within." |
1199 | 1200 |
1200 ;; We set this before actually doing it to avoid the possibility | 1201 ;; We set this before actually doing it to avoid the possibility |
1201 ;; of an infinite loop if ange-ftp-netrc-filename is an FTP file. | 1202 ;; of an infinite loop if ange-ftp-netrc-filename is an FTP file. |
1202 (interactive) | 1203 (interactive) |
1342 (ange-ftp-ftp-name buffer-file-name)) | 1343 (ange-ftp-ftp-name buffer-file-name)) |
1343 (progn | 1344 (progn |
1344 (auto-save-mode ange-ftp-auto-save)))) | 1345 (auto-save-mode ange-ftp-auto-save)))) |
1345 | 1346 |
1346 (defun ange-ftp-kill-ftp-process (buffer) | 1347 (defun ange-ftp-kill-ftp-process (buffer) |
1347 "If the BUFFER's visited filename or default-directory is an ftp filename | 1348 "Kill the FTP process associated with BUFFER." |
1349 If the BUFFER's visited filename or default-directory is an ftp filename | |
1348 then kill the related ftp process." | 1350 then kill the related ftp process." |
1349 (interactive "bKill FTP process associated with buffer: ") | 1351 (interactive "bKill FTP process associated with buffer: ") |
1350 (if (null buffer) | 1352 (if (null buffer) |
1351 (setq buffer (current-buffer))) | 1353 (setq buffer (current-buffer))) |
1352 (let ((file (or (buffer-file-name) default-directory))) | 1354 (let ((file (or (buffer-file-name) default-directory))) |
2397 "Regexp matching directories which are listed in dl format. This regexp | 2399 "Regexp matching directories which are listed in dl format. This regexp |
2398 shouldn't be anchored with a trailing $ so that it will match subdirectories | 2400 shouldn't be anchored with a trailing $ so that it will match subdirectories |
2399 as well.") | 2401 as well.") |
2400 | 2402 |
2401 (defun ange-ftp-add-dl-dir (dir) | 2403 (defun ange-ftp-add-dl-dir (dir) |
2402 "Interactively adds a given directory to ange-ftp-dl-dir-regexp." | 2404 "Interactively adds a DIR to ange-ftp-dl-dir-regexp." |
2403 (interactive | 2405 (interactive |
2404 (list (read-string "Directory: " | 2406 (list (read-string "Directory: " |
2405 (let ((name (or (buffer-file-name) | 2407 (let ((name (or (buffer-file-name) |
2406 (and (eq major-mode 'dired-mode) | 2408 (and (eq major-mode 'dired-mode) |
2407 dired-directory)))) | 2409 dired-directory)))) |
2565 ;; may not have a lot to do with what went wrong. | 2567 ;; may not have a lot to do with what went wrong. |
2566 (ange-ftp-hash-entry-exists-p file | 2568 (ange-ftp-hash-entry-exists-p file |
2567 (ange-ftp-get-files dir)))))) | 2569 (ange-ftp-get-files dir)))))) |
2568 | 2570 |
2569 (defun ange-ftp-get-file-entry (name) | 2571 (defun ange-ftp-get-file-entry (name) |
2570 "Given NAME, return the given file entry which will be either t for a | 2572 "Given NAME, return the given file entry. |
2571 directory, nil for a normal file, or a string for a symlink. If the file | 2573 The entry will be either t for a directory, nil for a normal file, |
2572 isn't in the hashtable, this also returns nil." | 2574 or a string for a symlink. If the file isn't in the hashtable, |
2575 this also returns nil." | |
2573 (let* ((name (directory-file-name name)) | 2576 (let* ((name (directory-file-name name)) |
2574 (dir (file-name-directory name)) | 2577 (dir (file-name-directory name)) |
2575 (ent (ange-ftp-get-hash-entry dir ange-ftp-files-hashtable)) | 2578 (ent (ange-ftp-get-hash-entry dir ange-ftp-files-hashtable)) |
2576 (file (ange-ftp-get-file-part name))) | 2579 (file (ange-ftp-get-file-part name))) |
2577 (if ent | 2580 (if ent |
3379 (ange-ftp-delete-file-entry filename)) | 3382 (ange-ftp-delete-file-entry filename)) |
3380 (ange-ftp-copy-file-internal filename newname t nil) | 3383 (ange-ftp-copy-file-internal filename newname t nil) |
3381 (delete-file filename)))) | 3384 (delete-file filename)))) |
3382 | 3385 |
3383 (defun ange-ftp-rename-local-to-remote (filename newname) | 3386 (defun ange-ftp-rename-local-to-remote (filename newname) |
3384 "Rename local FILE to remote file NEWNAME." | 3387 "Rename local FILENAME to remote file NEWNAME." |
3385 (let* ((fabbr (ange-ftp-abbreviate-filename filename)) | 3388 (let* ((fabbr (ange-ftp-abbreviate-filename filename)) |
3386 (nabbr (ange-ftp-abbreviate-filename newname filename)) | 3389 (nabbr (ange-ftp-abbreviate-filename newname filename)) |
3387 (msg (format "Renaming %s to %s" fabbr nabbr))) | 3390 (msg (format "Renaming %s to %s" fabbr nabbr))) |
3388 (ange-ftp-copy-file-internal filename newname t nil msg) | 3391 (ange-ftp-copy-file-internal filename newname t nil msg) |
3389 (let (ange-ftp-process-verbose) | 3392 (let (ange-ftp-process-verbose) |
3390 (delete-file filename)))) | 3393 (delete-file filename)))) |
3391 | 3394 |
3392 (defun ange-ftp-rename-remote-to-local (filename newname) | 3395 (defun ange-ftp-rename-remote-to-local (filename newname) |
3393 "Rename remote file FILE to local file NEWNAME." | 3396 "Rename remote file FILENAME to local file NEWNAME." |
3394 (let* ((fabbr (ange-ftp-abbreviate-filename filename)) | 3397 (let* ((fabbr (ange-ftp-abbreviate-filename filename)) |
3395 (nabbr (ange-ftp-abbreviate-filename newname filename)) | 3398 (nabbr (ange-ftp-abbreviate-filename newname filename)) |
3396 (msg (format "Renaming %s to %s" fabbr nabbr))) | 3399 (msg (format "Renaming %s to %s" fabbr nabbr))) |
3397 (ange-ftp-copy-file-internal filename newname t nil msg) | 3400 (ange-ftp-copy-file-internal filename newname t nil msg) |
3398 (let (ange-ftp-process-verbose) | 3401 (let (ange-ftp-process-verbose) |