;;; shadowfile.el --- automatic file copying
;; Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
;; Author: Boris Goldowsky <boris@gnu.org>
;; Keywords: comm files
call it manually."
(interactive "P")
(if (not shadow-files-to-copy)
- (if (interactive-p)
+ (if (called-interactively-p 'interactive)
(message "No files need to be shadowed."))
(save-excursion
(map-y-or-n-p (function
(set-buffer buffer)
(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))
+ (write-region nil nil to)
(shadow-remove-from-todo s))
(error (message "Shadow %s not updated!" (cdr s)))))))
(defun shadow-save-todo-file ()
(if (and shadow-todo-buffer (buffer-modified-p shadow-todo-buffer))
- (save-excursion
- (set-buffer shadow-todo-buffer)
+ (with-current-buffer shadow-todo-buffer
(condition-case nil ; have to continue even in case of
(basic-save-buffer) ; error, otherwise kill-emacs might
(error ; not work!