Mercurial > emacs
changeset 100645:4caea5d62b15
(shadow-copy-file): Handle buffer-swapped-with.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 22 Dec 2008 20:20:04 +0000 |
parents | a4a09df46d2f |
children | 7ad0cf8d61fb |
files | lisp/shadowfile.el |
diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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)))))))