Commit 3742f39f authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(tar-mode-revert): Cope if user cancels the revert.

parent 57e3d22a
...@@ -630,11 +630,19 @@ appear on disk when you save the tar-file's buffer." ...@@ -630,11 +630,19 @@ appear on disk when you save the tar-file's buffer."
;; Revert the buffer and recompute the dired-like listing. ;; Revert the buffer and recompute the dired-like listing.
(defun tar-mode-revert (&optional no-autosave no-confirm) (defun tar-mode-revert (&optional no-autosave no-confirm)
(let ((revert-buffer-function nil)
(old-offset tar-header-offset)
success)
(setq tar-header-offset nil) (setq tar-header-offset nil)
(let ((revert-buffer-function nil)) (unwind-protect
(revert-buffer t no-confirm) (and (revert-buffer t no-confirm)
(widen)) (progn (widen)
(tar-mode)) (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) (defun tar-next-line (p)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment