X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/56388398e7a1251497f002072c061002ec9d9e81..73b0cd50031a714347109169ceb8bacae338612a:/lisp/shadowfile.el diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el index 8d6f294efc..c88b55e964 100644 --- a/lisp/shadowfile.el +++ b/lisp/shadowfile.el @@ -1,17 +1,16 @@ ;;; shadowfile.el --- automatic file copying -;; Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +;; Copyright (C) 1993-1994, 2001-2011 Free Software Foundation, Inc. ;; Author: Boris Goldowsky ;; Keywords: comm files ;; This file is part of GNU Emacs. -;; GNU Emacs is free software; you can redistribute it and/or modify +;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -19,9 +18,7 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GNU Emacs. If not, see . ;;; Commentary: @@ -90,14 +87,14 @@ :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) @@ -512,7 +509,7 @@ Pending copies are stored in variable `shadow-files-to-copy', and in 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 @@ -575,13 +572,11 @@ 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 + (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. @@ -711,8 +706,7 @@ With non-nil argument also saves the buffer." (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! @@ -766,7 +760,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 @@ -809,10 +803,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") @@ -836,5 +831,4 @@ look for files that have been changed and need to be copied to other systems." (provide 'shadowfile) -;;; arch-tag: e2f4cdd7-2bab-4def-9130-9e69b412b79e ;;; shadowfile.el ends here