]> git.eshelyaron.com Git - emacs.git/commitdiff
(tar-extract): Setup the buffer's name, undo-list, and
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 14 Mar 2009 03:03:25 +0000 (03:03 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 14 Mar 2009 03:03:25 +0000 (03:03 +0000)
modified status before running the major-mode.

lisp/ChangeLog
lisp/tar-mode.el

index 38886bb0e18a565240cb259cfbb5cfc097504939..e056053641f0eecc073aa6e0401a95fbd7b62dca 100644 (file)
@@ -5,6 +5,9 @@
 
 2009-03-14  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * 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  <tassilo@member.fsf.org>
index 07d1a54d87be8128650c5603dd5ef751a6f7a9f6..5da38db052b4d145f0bbcad0ee673f2a0cc38f92 100644 (file)
@@ -622,10 +622,6 @@ inside of a tar archive without extracting it and re-archiving it.
 
 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 @@ appear on disk when you save the tar-file's buffer."
           (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