(vc-cvs-checkout): Fix bug that broke C-x v ~-style checkouts.
[bpt/emacs.git] / lisp / shadowfile.el
index 1302171..1cc3436 100644 (file)
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 1993, 1994 Free Software Foundation, Inc.
 
-;; Author: Boris Goldowsky <boris@gnu.ai.mit.edu>
+;; Author: Boris Goldowsky <boris@gnu.org>
 ;; Keywords: comm
 
 ;; This file is part of GNU Emacs.
@@ -71,7 +71,7 @@
 ;;  - It will not make directories for you, it just fails to copy files
 ;;  that belong in non-existent directories.
 ;;
-;;  Please report any bugs to me (boris@gnu.ai.mit.edu).  Also let me know
+;;  Please report any bugs to me (boris@gnu.org).  Also let me know
 ;;  if you have suggestions or would like to be informed of updates.
 
 ;;; Code:
@@ -79,8 +79,6 @@
 (provide 'shadowfile)
 (require 'ange-ftp)
 
-(setq find-file-visit-truename t)      ; makes life easier with symbolic links
-
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Variables
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -94,7 +92,7 @@
   "*If t, always copy shadow files without asking.
 If nil \(the default), always ask.  If not nil and not t, ask only if there
 is no buffer currently visiting the file."
-  :type '(choice (const t) (const nil) (const :tag "Ask if no buffer" maybe))
+  :type '(choice (const t) (const nil) (other :tag "Ask if no buffer" maybe))
   :group 'shadow)
 
 (defcustom shadow-inhibit-message nil
@@ -170,11 +168,6 @@ created by shadow-define-regexp-group.")
 ;;; Syntactic sugar; General list and string manipulation
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(defmacro shadow-when (condition &rest body)
-  ;; From cl.el
-  "(shadow-when CONDITION . BODY) => evaluate BODY if CONDITION is true."
-  (` (if (not (, condition))  ()  (,@ body))))
-  
 (defun shadow-union (a b)
   "Add members of list A to list B
 if they are not equal to items already in B."
@@ -586,7 +579,7 @@ site."
                              (car s))))
                 (find-file-noselect (car s)))))
         (to (shadow-expand-cluster-in-file-name (cdr s))))
-    (shadow-when buffer
+    (when buffer
       (set-buffer buffer)
       (save-restriction
        (widen)
@@ -641,10 +634,10 @@ of files needing to be copied."
   (let ((shadows (shadow-shadows-of 
                  (shadow-expand-file-name 
                   (buffer-file-name (current-buffer))))))
-    (shadow-when shadows
+    (when shadows
       (setq shadow-files-to-copy
            (shadow-union shadows shadow-files-to-copy))
-      (shadow-when (not shadow-inhibit-message)
+      (when (not shadow-inhibit-message)
        (message "%s" (substitute-command-keys
                       "Use \\[shadow-copy-files] to update shadows."))
        (sit-for 1))
@@ -672,23 +665,23 @@ Returns t unless files were locked; then returns nil."
        (sit-for 3)
        nil)
     (save-excursion
-      (shadow-when shadow-info-file
+      (when shadow-info-file
        (set-buffer (setq shadow-info-buffer
                          (find-file-noselect shadow-info-file)))
-       (shadow-when (and (not (buffer-modified-p))
-                         (file-newer-than-file-p (make-auto-save-file-name)
-                                                 shadow-info-file))
+       (when (and (not (buffer-modified-p))
+                  (file-newer-than-file-p (make-auto-save-file-name)
+                                          shadow-info-file))
          (erase-buffer)
          (message "Data recovered from %s." 
                   (car (insert-file-contents (make-auto-save-file-name))))
          (sit-for 1))
        (eval-current-buffer))
-      (shadow-when shadow-todo-file
+      (when shadow-todo-file
        (set-buffer (setq shadow-todo-buffer 
                          (find-file-noselect shadow-todo-file)))
-       (shadow-when (and (not (buffer-modified-p))
-                         (file-newer-than-file-p (make-auto-save-file-name)
-                                                 shadow-todo-file))
+       (when (and (not (buffer-modified-p))
+                  (file-newer-than-file-p (make-auto-save-file-name)
+                                          shadow-todo-file))
          (erase-buffer)
          (message "Data recovered from %s." 
                   (car (insert-file-contents (make-auto-save-file-name))))
@@ -800,7 +793,7 @@ look for files that have been changed and need to be copied to other systems."
 ;; This is on hold until someone tells me about a working version of
 ;; map-ynp for Lucid Emacs.
 
-;(shadow-when (string-match "Lucid" emacs-version)
+;(when (string-match "Lucid" emacs-version)
 ;  (require 'symlink-fix)
 ;  (require 'ange-ftp)
 ;  (require 'map-ynp)
@@ -834,8 +827,8 @@ look for files that have been changed and need to be copied to other systems."
        (message "Shadowfile information files not found - aborting")
        (beep)
        (sit-for 3))
-    (shadow-when (and (not shadow-inhibit-overload)
-                     (not (fboundp 'shadow-orig-save-buffers-kill-emacs)))
+    (when (and (not shadow-inhibit-overload)
+              (not (fboundp 'shadow-orig-save-buffers-kill-emacs)))
       (fset 'shadow-orig-save-buffers-kill-emacs 
            (symbol-function 'save-buffers-kill-emacs))
       (fset 'save-buffers-kill-emacs
@@ -843,12 +836,4 @@ look for files that have been changed and need to be copied to other systems."
     (add-hook 'write-file-hooks 'shadow-add-to-todo)
     (define-key ctl-x-4-map "s" 'shadow-copy-files)))
 
-(if noninteractive
-    (add-hook 'after-init-hook 'shadow-initialize)
-  (shadow-initialize))
-
-;;;Local Variables:
-;;;eval:(put 'shadow-when 'lisp-indent-hook 1)
-;;;End:
-
 ;;; shadowfile.el ends here