comparison lisp/ange-ftp.el @ 10407:8b26137996f9

(ange-ftp-set-buffer-mode): Don't set make-backup-files. (ange-ftp-real-find-backup-file-name): New function. (ange-ftp-find-backup-file-name): New function. Use it to handle find-backup-file-name.
author Richard M. Stallman <rms@gnu.org>
date Thu, 12 Jan 1995 21:03:32 +0000
parents 3d95ea97eb9e
children bc83756f19ad
comparison
equal deleted inserted replaced
10406:e656e5fe190d 10407:8b26137996f9
61 ;;; 61 ;;;
62 ;;; Passwords for the user "anonymous" (or "ftp") are handled 62 ;;; Passwords for the user "anonymous" (or "ftp") are handled
63 ;;; specially. The variable `ange-ftp-generate-anonymous-password' 63 ;;; specially. The variable `ange-ftp-generate-anonymous-password'
64 ;;; controls what happens: if the value of this variable is a string, 64 ;;; controls what happens: if the value of this variable is a string,
65 ;;; then this is used as the password; if non-nil (the default), then 65 ;;; then this is used as the password; if non-nil (the default), then
66 ;;; a password is created from the name of the user and the hostname 66 ;;; the value of `user-mail-address' is used; if nil then the user
67 ;;; of the machine on which GNU Emacs is running; if nil then the user
68 ;;; is prompted for a password as normal. 67 ;;; is prompted for a password as normal.
69 68
70 ;;; "Dumb" UNIX hosts: 69 ;;; "Dumb" UNIX hosts:
71 ;;; 70 ;;;
72 ;;; The FTP servers on some UNIX machines have problems if the 'ls' command is 71 ;;; The FTP servers on some UNIX machines have problems if the 'ls' command is
1322 1321
1323 (defun ange-ftp-set-buffer-mode () 1322 (defun ange-ftp-set-buffer-mode ()
1324 "Set correct modes for the current buffer if visiting a remote file." 1323 "Set correct modes for the current buffer if visiting a remote file."
1325 (if (and (stringp buffer-file-name) 1324 (if (and (stringp buffer-file-name)
1326 (ange-ftp-ftp-name buffer-file-name)) 1325 (ange-ftp-ftp-name buffer-file-name))
1327 (progn 1326 (auto-save-mode ange-ftp-auto-save)))
1328 (make-local-variable 'make-backup-files)
1329 (setq make-backup-files ange-ftp-make-backup-files)
1330 (auto-save-mode ange-ftp-auto-save))))
1331 1327
1332 (defun ange-ftp-kill-ftp-process (buffer) 1328 (defun ange-ftp-kill-ftp-process (buffer)
1333 "Kill the FTP process associated with BUFFER. 1329 "Kill the FTP process associated with BUFFER.
1334 If the BUFFER's visited filename or default-directory is an ftp filename 1330 If the BUFFER's visited filename or default-directory is an ftp filename
1335 then kill the related ftp process." 1331 then kill the related ftp process."
3800 (let (ange-ftp-process-verbose) 3796 (let (ange-ftp-process-verbose)
3801 (delete-file file)) 3797 (delete-file file))
3802 (ange-ftp-copy-file-internal tmp2 nfile t nil msg2)))) 3798 (ange-ftp-copy-file-internal tmp2 nfile t nil msg2))))
3803 (ange-ftp-del-tmp-name tmp1) 3799 (ange-ftp-del-tmp-name tmp1)
3804 (ange-ftp-del-tmp-name tmp2)))) 3800 (ange-ftp-del-tmp-name tmp2))))
3801
3802 (defun ange-ftp-find-backup-file-name (fn)
3803 ;; Either return the ordinary backup name, etc.,
3804 ;; or return nil meaning don't make a backup.
3805 (if ange-ftp-make-backup-files
3806 (ange-ftp-real-find-backup-file-name fn)))
3805 3807
3806 ;;; Define the handler for special file names 3808 ;;; Define the handler for special file names
3807 ;;; that causes ange-ftp to be invoked. 3809 ;;; that causes ange-ftp to be invoked.
3808 3810
3809 ;;;###autoload 3811 ;;;###autoload
3871 'ange-ftp-unhandled-file-name-directory) 3873 'ange-ftp-unhandled-file-name-directory)
3872 (put 'file-name-sans-versions 'ange-ftp 'ange-ftp-file-name-sans-versions) 3874 (put 'file-name-sans-versions 'ange-ftp 'ange-ftp-file-name-sans-versions)
3873 (put 'dired-uncache 'ange-ftp 'ange-ftp-dired-uncache) 3875 (put 'dired-uncache 'ange-ftp 'ange-ftp-dired-uncache)
3874 (put 'dired-compress-file 'ange-ftp 'ange-ftp-dired-compress-file) 3876 (put 'dired-compress-file 'ange-ftp 'ange-ftp-dired-compress-file)
3875 (put 'load 'ange-ftp 'ange-ftp-load) 3877 (put 'load 'ange-ftp 'ange-ftp-load)
3878 (put 'find-backup-file-name 'ange-ftp 'ange-ftp-find-backup-file-name)
3876 3879
3877 ;; Turn off truename processing to save time. 3880 ;; Turn off truename processing to save time.
3878 ;; Treat each name as its own truename. 3881 ;; Treat each name as its own truename.
3879 (put 'file-truename 'ange-ftp 'identity) 3882 (put 'file-truename 'ange-ftp 'identity)
3880 3883
3950 (ange-ftp-run-real-handler 'file-name-sans-versions args)) 3953 (ange-ftp-run-real-handler 'file-name-sans-versions args))
3951 (defun ange-ftp-real-shell-command (&rest args) 3954 (defun ange-ftp-real-shell-command (&rest args)
3952 (ange-ftp-run-real-handler 'shell-command args)) 3955 (ange-ftp-run-real-handler 'shell-command args))
3953 (defun ange-ftp-real-load (&rest args) 3956 (defun ange-ftp-real-load (&rest args)
3954 (ange-ftp-run-real-handler 'load args)) 3957 (ange-ftp-run-real-handler 'load args))
3958 (defun ange-ftp-real-find-backup-file-name (&rest args)
3959 (ange-ftp-run-real-handler 'find-backup-file-name args))
3955 3960
3956 ;; Here we support using dired on remote hosts. 3961 ;; Here we support using dired on remote hosts.
3957 ;; I have turned off the support for using dired on foreign directory formats. 3962 ;; I have turned off the support for using dired on foreign directory formats.
3958 ;; That involves too many unclean hooks. 3963 ;; That involves too many unclean hooks.
3959 ;; It would be cleaner to support such operations by 3964 ;; It would be cleaner to support such operations by