]> git.eshelyaron.com Git - emacs.git/commitdiff
(shadow-copy-file): Handle buffer-swapped-with.
authorRichard M. Stallman <rms@gnu.org>
Mon, 22 Dec 2008 20:20:25 +0000 (20:20 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 22 Dec 2008 20:20:25 +0000 (20:20 +0000)
lisp/ChangeLog
lisp/shadowfile.el

index 15ef4269f5131897e9185661d22249f7e8ae9f5c..5c15bfb1f4d2ebc04c1f9c72c7c9f1339f88d5bd 100644 (file)
@@ -1,5 +1,11 @@
 2008-12-22  Richard M Stallman  <rms@gnu.org>
 
+       * shadowfile.el (shadow-copy-file): Handle buffer-swapped-with.
+
+       * files.el (buffer-swapped-with): New variable.
+       (basic-save-buffer-0): Most of basic-save-buffer moved here.
+       (basic-save-buffer): Unswap the buffer temporarily if nec.
+
        * dired.el (dired-readin): Inhibit modification hooks.
 
 2008-12-22  Ulf Jasper  <ulf.jasper@web.de>
index 751a33d260d9661884c3162d36f39b169b8c03ff..ece12c367e12c5265742e7f426da8db801c72d39 100644 (file)
@@ -574,8 +574,14 @@ site."
     (when buffer
       (set-buffer buffer)
       (condition-case i
-          (progn
-            (write-region nil nil to)
+         (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)))))))