aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1996-06-12 21:50:08 +0000
committerRichard M. Stallman1996-06-12 21:50:08 +0000
commit3742f39f26c7cc73c113bd3117059c8107647353 (patch)
tree9da6f75ce79d79d5c3088b44a67192365ec9a867 /lisp
parent57e3d22a51e6bca0ff7bc94ed30739dafc09cb91 (diff)
downloademacs-3742f39f26c7cc73c113bd3117059c8107647353.tar.gz
emacs-3742f39f26c7cc73c113bd3117059c8107647353.zip
(tar-mode-revert): Cope if user cancels the revert.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/tar-mode.el18
1 files changed, 13 insertions, 5 deletions
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el
index ce8ed3b6184..9ac9eb90e08 100644
--- a/lisp/tar-mode.el
+++ b/lisp/tar-mode.el
@@ -630,11 +630,19 @@ appear on disk when you save the tar-file's buffer."
630 630
631;; Revert the buffer and recompute the dired-like listing. 631;; Revert the buffer and recompute the dired-like listing.
632(defun tar-mode-revert (&optional no-autosave no-confirm) 632(defun tar-mode-revert (&optional no-autosave no-confirm)
633 (setq tar-header-offset nil) 633 (let ((revert-buffer-function nil)
634 (let ((revert-buffer-function nil)) 634 (old-offset tar-header-offset)
635 (revert-buffer t no-confirm) 635 success)
636 (widen)) 636 (setq tar-header-offset nil)
637 (tar-mode)) 637 (unwind-protect
638 (and (revert-buffer t no-confirm)
639 (progn (widen)
640 (setq success t)
641 (tar-mode)))
642 ;; If the revert was canceled,
643 ;; put back the old value of tar-header-offset.
644 (or success
645 (setq tar-header-offset old-offset)))))
638 646
639 647
640(defun tar-next-line (p) 648(defun tar-next-line (p)