# HG changeset patch # User Richard M. Stallman # Date 1229977204 0 # Node ID 4caea5d62b15276676da52d25b18ef6043aa6be0 # Parent a4a09df46d2fb87bdc78b1d30a2da30b3f8f9a32 (shadow-copy-file): Handle buffer-swapped-with. diff -r a4a09df46d2f -r 4caea5d62b15 lisp/shadowfile.el --- a/lisp/shadowfile.el Mon Dec 22 20:11:51 2008 +0000 +++ b/lisp/shadowfile.el Mon Dec 22 20:20:04 2008 +0000 @@ -574,8 +574,14 @@ (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)))))))