]> code.delx.au - gnu-emacs/blobdiff - lisp/tar-mode.el
*** empty log message ***
[gnu-emacs] / lisp / tar-mode.el
index 041f0fddc1a45725f6411ab4c86bdc0c120f763e..0e57d541dfe6ae259563837cac8b02c5708eb295 100644 (file)
@@ -1,7 +1,7 @@
 ;;; tar-mode.el --- simple editing of tar files from GNU emacs
 
-;; Copyright (C) 1990,91,93,94,95,96,97,98,99,2000,01,2004
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+;;   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 ;; Author: Jamie Zawinski <jwz@lucid.com>
 ;; Maintainer: FSF
@@ -735,7 +735,9 @@ appear on disk when you save the tar-file's buffer."
                             (and set-auto-coding-function
                                  (save-excursion
                                    (funcall set-auto-coding-function
-                                            name (- (point-max) (point)))))))
+                                            name (- (point-max) (point)))))
+                            (car (find-operation-coding-system
+                                  'insert-file-contents name t))))
                        (multibyte enable-multibyte-characters)
                        (detected (detect-coding-region
                                   (point-min)
@@ -747,13 +749,7 @@ appear on disk when you save the tar-file's buffer."
                                          coding
                                          (coding-system-eol-type detected))))
                      (setq coding
-                           (or (find-new-buffer-file-coding-system detected)
-                               (let ((file-coding
-                                      (find-operation-coding-system
-                                       'insert-file-contents buffer-file-name)))
-                                 (if (consp file-coding)
-                                     (setq file-coding (car file-coding))
-                                   file-coding)))))
+                           (find-new-buffer-file-coding-system detected)))
                    (if (or (eq coding 'no-conversion)
                            (eq (coding-system-type coding) 5))
                        (setq multibyte (set-buffer-multibyte nil)))
@@ -1120,7 +1116,7 @@ to make your changes permanent."
        (descriptor tar-superior-descriptor)
        subfile-size)
     ;; We must make the current buffer unibyte temporarily to avoid
-    ;; multibyte->unibyte conversion in `insert-buffer'.
+    ;; multibyte->unibyte conversion in `insert-buffer-substring'.
     (set-buffer-multibyte nil)
     (setq subfile-size (buffer-size))
     (set-buffer tar-superior-buffer)
@@ -1144,7 +1140,7 @@ to make your changes permanent."
          (delete-region data-start data-end)
          ;; insert the new data...
          (goto-char data-start)
-         (insert-buffer subfile)
+         (insert-buffer-substring subfile)
          (setq subfile-size
                (encode-coding-region
                 data-start (+ data-start subfile-size) coding))