# HG changeset patch # User Richard M. Stallman # Date 834616208 0 # Node ID 85a85480fa3c4f18f8e8e8647ff6fc560a314ae8 # Parent 5b9fe08fa6eb8f068d9f7adf7db2a1265e441b92 (tar-mode-revert): Cope if user cancels the revert. diff -r 5b9fe08fa6eb -r 85a85480fa3c lisp/tar-mode.el --- a/lisp/tar-mode.el Wed Jun 12 21:49:19 1996 +0000 +++ b/lisp/tar-mode.el Wed Jun 12 21:50:08 1996 +0000 @@ -630,11 +630,19 @@ ;; Revert the buffer and recompute the dired-like listing. (defun tar-mode-revert (&optional no-autosave no-confirm) - (setq tar-header-offset nil) - (let ((revert-buffer-function nil)) - (revert-buffer t no-confirm) - (widen)) - (tar-mode)) + (let ((revert-buffer-function nil) + (old-offset tar-header-offset) + success) + (setq tar-header-offset nil) + (unwind-protect + (and (revert-buffer t no-confirm) + (progn (widen) + (setq success t) + (tar-mode))) + ;; If the revert was canceled, + ;; put back the old value of tar-header-offset. + (or success + (setq tar-header-offset old-offset))))) (defun tar-next-line (p)