# HG changeset patch # User Stefan Monnier # Date 1236999805 0 # Node ID f4adb8b6af6c2b8343f9d01f1c92c9421a3ba927 # Parent 061690191e25acb00b6ec4489e1d34b347d7918e (tar-extract): Setup the buffer's name, undo-list, and modified status before running the major-mode. diff -r 061690191e25 -r f4adb8b6af6c lisp/ChangeLog --- a/lisp/ChangeLog Sat Mar 14 02:12:06 2009 +0000 +++ b/lisp/ChangeLog Sat Mar 14 03:03:25 2009 +0000 @@ -5,6 +5,9 @@ 2009-03-14 Stefan Monnier + * tar-mode.el (tar-extract): Setup the buffer's name, undo-list, and + modified status before running the major-mode. + * simple.el (undo): Don't loop when encountering empty undo records. 2009-03-13 Tassilo Horn diff -r 061690191e25 -r f4adb8b6af6c lisp/tar-mode.el --- a/lisp/tar-mode.el Sat Mar 14 02:12:06 2009 +0000 +++ b/lisp/tar-mode.el Sat Mar 14 03:03:25 2009 +0000 @@ -622,10 +622,6 @@ See also: variables `tar-update-datestamp' and `tar-anal-blocksize'. \\{tar-mode-map}" - ;; this is not interactive because you shouldn't be turning this - ;; mode on and off. You can corrupt things that way. - ;; rms: with permanent locals, it should now be possible to make this work - ;; interactively in some reasonable fashion. (make-local-variable 'tar-parse-info) (set (make-local-variable 'require-final-newline) nil) ; binary data, dude... (set (make-local-variable 'local-enable-local-variables) nil) @@ -839,15 +835,13 @@ (setq default-directory (with-current-buffer tar-buffer default-directory)) - (normal-mode) ; pick a mode. (rename-buffer bufname) - (make-local-variable 'tar-superior-buffer) - (make-local-variable 'tar-superior-descriptor) - (setq tar-superior-buffer tar-buffer) - (setq tar-superior-descriptor descriptor) - (setq buffer-read-only read-only-p) (set-buffer-modified-p nil) (setq buffer-undo-list undo-list) + (normal-mode) ; pick a mode. + (set (make-local-variable 'tar-superior-buffer) tar-buffer) + (set (make-local-variable 'tar-superior-descriptor) descriptor) + (setq buffer-read-only read-only-p) (tar-subfile-mode 1))) (if view-p (view-buffer