changeset 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 e656e5fe190d
children c79720be7bd7
files lisp/ange-ftp.el
diffstat 1 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ange-ftp.el	Thu Jan 12 21:02:30 1995 +0000
+++ b/lisp/ange-ftp.el	Thu Jan 12 21:03:32 1995 +0000
@@ -63,8 +63,7 @@
 ;;; specially.  The variable `ange-ftp-generate-anonymous-password'
 ;;; controls what happens: if the value of this variable is a string,
 ;;; then this is used as the password; if non-nil (the default), then
-;;; a password is created from the name of the user and the hostname
-;;; of the machine on which GNU Emacs is running; if nil then the user
+;;; the value of `user-mail-address' is used; if nil then the user
 ;;; is prompted for a password as normal.
 
 ;;; "Dumb" UNIX hosts:
@@ -1324,10 +1323,7 @@
   "Set correct modes for the current buffer if visiting a remote file."
   (if (and (stringp buffer-file-name)
 	   (ange-ftp-ftp-name buffer-file-name))
-      (progn
-	(make-local-variable 'make-backup-files)
-	(setq make-backup-files ange-ftp-make-backup-files)
-	(auto-save-mode ange-ftp-auto-save))))
+      (auto-save-mode ange-ftp-auto-save)))
 
 (defun ange-ftp-kill-ftp-process (buffer)
   "Kill the FTP process associated with BUFFER.
@@ -3802,6 +3798,12 @@
 		(ange-ftp-copy-file-internal tmp2 nfile t nil msg2))))
       (ange-ftp-del-tmp-name tmp1)
       (ange-ftp-del-tmp-name tmp2))))
+
+(defun ange-ftp-find-backup-file-name (fn)
+  ;; Either return the ordinary backup name, etc.,
+  ;; or return nil meaning don't make a backup.
+  (if ange-ftp-make-backup-files
+      (ange-ftp-real-find-backup-file-name fn)))
 
 ;;; Define the handler for special file names
 ;;; that causes ange-ftp to be invoked.
@@ -3873,6 +3875,7 @@
 (put 'dired-uncache 'ange-ftp 'ange-ftp-dired-uncache)
 (put 'dired-compress-file 'ange-ftp 'ange-ftp-dired-compress-file)
 (put 'load 'ange-ftp 'ange-ftp-load)
+(put 'find-backup-file-name 'ange-ftp 'ange-ftp-find-backup-file-name)
 
 ;; Turn off truename processing to save time.
 ;; Treat each name as its own truename.
@@ -3952,6 +3955,8 @@
   (ange-ftp-run-real-handler 'shell-command args))
 (defun ange-ftp-real-load (&rest args)
   (ange-ftp-run-real-handler 'load args))
+(defun ange-ftp-real-find-backup-file-name (&rest args)
+  (ange-ftp-run-real-handler 'find-backup-file-name args))
 
 ;; Here we support using dired on remote hosts.
 ;; I have turned off the support for using dired on foreign directory formats.