Subject: Re: bug#18344: Archive (e.g. tarball) file buffers are editable, but have no undo information

From: Glenn Morris <[email-masked]>
Date: Thu, 28 Aug 2014 15:16:28 -0400

Following seems to fix it for me

*** lisp/tar-mode.el	2014-02-10 01:34:22 +0000
--- lisp/tar-mode.el	2014-08-28 19:11:24 +0000
***************
*** 800,807 ****
                            tarname
                            ")"))
           (buffer (generate-new-buffer bufname)))
-     (with-current-buffer buffer
-       (setq buffer-undo-list t))
      (with-current-buffer tar-data-buffer
        (let (coding)
          (narrow-to-region start end)
--- 800,805 ----
***************
*** 829,835 ****
              (with-current-buffer buffer
                (set-buffer-multibyte nil)))
          (widen)
!         (decode-coding-region start end coding buffer)))
      buffer))
  
  (defun tar-extract (&optional other-window-p)
--- 827,837 ----
              (with-current-buffer buffer
                (set-buffer-multibyte nil)))
          (widen)
!         (with-current-buffer buffer
!           (setq buffer-undo-list t))
!         (decode-coding-region start end coding buffer)
!         (with-current-buffer buffer
!           (setq buffer-undo-list nil))))
      buffer))
  
  (defun tar-extract (&optional other-window-p)
***************
*** 869,875 ****
                (with-current-buffer tar-buffer
                  default-directory))
          (set-buffer-modified-p nil)
-         (setq buffer-undo-list t)
          (normal-mode)                   ; pick a mode.
          (set (make-local-variable 'tar-superior-buffer) tar-buffer)
          (set (make-local-variable 'tar-superior-descriptor) descriptor)
--- 871,876 ----