Add bug id for recently fixed bugs.
[bpt/emacs.git] / lisp / shadowfile.el
index 29eb04e..ece12c3 100644 (file)
   :group 'files)
 
 (defcustom shadow-noquery nil
-  "*If t, always copy shadow files without asking.
+  "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) (other :tag "Ask if no buffer" maybe))
   :group 'shadow)
 
 (defcustom shadow-inhibit-message nil
-  "*If non-nil, do not display a message when a file needs copying."
+  "If non-nil, do not display a message when a file needs copying."
   :type 'boolean
   :group 'shadow)
 
@@ -573,13 +573,17 @@ site."
         (to (shadow-expand-cluster-in-file-name (cdr s))))
     (when buffer
       (set-buffer buffer)
-      (save-restriction
-       (widen)
-       (condition-case i
-           (progn
-             (write-region (point-min) (point-max) to)
-             (shadow-remove-from-todo s))
-         (error (message "Shadow %s not updated!" (cdr s))))))))
+      (condition-case i
+         (progn
+           (if buffer-swapped-with
+               (progn
+                 (buffer-swap-text buffer-swapped-with)
+                 (unwind-protect
+                     (write-region nil nil to)
+                   (buffer-swap-text buffer-swapped-with)))
+             (write-region nil nil to))
+            (shadow-remove-from-todo s))
+        (error (message "Shadow %s not updated!" (cdr s)))))))
 
 (defun shadow-shadows-of (file)
   "Return copy operations needed to update FILE.
@@ -764,7 +768,7 @@ look for files that have been changed and need to be copied to other systems."
                                (buffer-list))))
           (yes-or-no-p "Modified buffers exist; exit anyway? "))
        (or (not (fboundp 'process-list))
-          ;; process-list is not defined on VMS.
+          ;; process-list is not defined on MSDOS.
           (let ((processes (process-list))
                 active)
             (while processes
@@ -807,10 +811,11 @@ look for files that have been changed and need to be copied to other systems."
            (file-name-as-directory (shadow-expand-file-name "~"))))
   (if (null shadow-info-file)
       (setq shadow-info-file
-           (shadow-expand-file-name "~/.shadows")))
+           (shadow-expand-file-name (convert-standard-filename "~/.shadows"))))
   (if (null shadow-todo-file)
       (setq shadow-todo-file
-           (shadow-expand-file-name "~/.shadow_todo")))
+           (shadow-expand-file-name
+            (convert-standard-filename "~/.shadow_todo"))))
   (if (not (shadow-read-files))
       (progn
        (message "Shadowfile information files not found - aborting")