[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: tar file's coding-system?



$BLpLZ$G$9!#(B

MARUYAMA Yoshio <maru@xxxxxxxxxxxx> writes:

>$B$&$^$/8+$($F$$$k$h$&$G$9!#467c(B!
>decode-coding-region $B$G(B 'undecided $B$r;XDj$7$?:]$K$I$N(B coding-system $B$,(B
>$BA*$P$l$?$N$+$C$F$o$+$k$s$G$7$g$&$+(B?
>$B$=$l$,$o$+$l$P!"$=$$$D$r(B tar-subfile-save-buffer $B$NF,$"$?$j$G@_Dj$7$F(B
>$B$d$l$P$A$c$s$H=q$-=P$;$k(B($B3JG<$G$-$k(B)$B$N$+$J$!$H$+;W$&$s$G$9$,(B...
>($BAG?M9M$((B)

$B;d$,2~B$$7$F;H$C$F$$$k(B tar-mode.el $B$G$O%U%!%$%k$N=q$-9~$_$b$G$-$^$9!#(B
diff $B$r:G8e$K$D$1$F$*$-$^$9!#(B

>Viewer $B$H$7$F$@$1$G$b==J,JXMx$G$O$"$k$s$G$9$1$I$M(B...
>$B$G$-$l$P(B ange-ftp $B$_$?$$$KIaDL$N%U%!%$%k$H6hJL$J$/(B dired $B$H$+$G$b07$($k$H(B
>$B4r$7$$$N$G$9$1$I$M(B... $BL5M}$+$J$!!#(B
>($B%"!<%+%$%V(B = $B%G%#%l%/%H%j$H$7$F07$($l$P(B...)

$B8E$$%a!<%k$r(B tar + gzip $B$7$?$b$N$r(B Gnus $B$GFI$`$?$a$K(B
$B$3$&$$$&$b$N$r:n$C$F$_$?$3$H$,$"$k$N$G$9$,!"(B
  $B!&CY$$(B
  $B!&%j%M!<%`$,<BAu$G$-$J$+$C$?!#(B
  $B!&8+$?$+$C$?$iE83+$9$l$P$$$$$8$c$s(B
$B$H$$$&M}M3$+$i:n$j$+$1$N$^$^$[$C$]$C$F$*$$$?5-21$,$"$j$^$9!#(B

$B$*$o$j(B
*** tar-mode.el.orig	Fri Jul 17 21:01:38 1998
--- tar-mode.el	Fri Jul 17 21:06:05 1998
***************
*** 723,729 ****
  	      (widen)
  	      (save-excursion
  		(set-buffer buffer)
! 		(insert-buffer-substring tar-buffer start end)
  		(goto-char 0)
  		(setq buffer-file-name
  		      (expand-file-name (concat tarname ":" name)))
--- 723,746 ----
  	      (widen)
  	      (save-excursion
  		(set-buffer buffer)
! 		;;; patch for mule by yagi begin
! 		(let ((coding-system (or coding-system-for-read
! 					 (car (find-operation-coding-system
! 					       'insert-file-contents name)))))
! 		  (buffer-disable-undo)
! 		  (insert-buffer-substring tar-buffer start end)
! 		  (if (eq (coding-system-type coding-system) t)
! 		      (let ((lis (detect-coding-region
! 				  (point-min) (point-max))))
! 			(setq coding-system (if (consp lis) (car lis) lis))))
! 		  (or (coding-system-p coding-system)
! 		      (setq coding-system 'binary))
! 		  (if (eq (coding-system-type coding-system) t)
! 		      (setq coding-system default-buffer-file-coding-system))
! 		  (decode-coding-region (point-min) (point-max) coding-system)
! 		  (set-buffer-file-coding-system coding-system)
! 		  (buffer-enable-undo))
! 		;;; patch for mule by yagi end
  		(goto-char 0)
  		(setq buffer-file-name
  		      (expand-file-name (concat tarname ":" name)))
***************
*** 1065,1070 ****
--- 1082,1104 ----
    (if (not (and (boundp 'tar-superior-descriptor) tar-superior-descriptor))
      (error "This buffer doesn't have an index into its superior tar file!"))
    (save-excursion
+ ;;;;; patch for mule by yagi begin
+   (let ((cur-buf (current-buffer))
+ 	(tmp-buf (get-buffer-create " *tar tmp*"))
+ 	(coding-system (or coding-system-for-write
+ 			   buffer-file-coding-system))
+ 	(descriptor tar-superior-descriptor)
+ 	(sup-buf tar-superior-buffer))
+     (set-buffer tmp-buf)
+     (make-local-variable 'tar-superior-descriptor)
+     (setq tar-superior-descriptor descriptor)
+     (make-local-variable 'tar-superior-buffer)
+     (setq tar-superior-buffer sup-buf)
+     (buffer-disable-undo)
+     (erase-buffer)
+     (insert-buffer cur-buf)
+     (encode-coding-region (point-min) (point-max) coding-system)
+ ;;;;; patch for mule by yagi end
    (let ((subfile (current-buffer))
  	(subfile-size (buffer-size))
  	(descriptor tar-superior-descriptor))
***************
*** 1147,1158 ****
  	(tar-pad-to-blocksize))
         (narrow-to-region 1 tar-header-offset)))
      (set-buffer-modified-p t)   ; mark the tar file as modified
!     (set-buffer subfile)
      (set-buffer-modified-p nil) ; mark the tar subfile as unmodified
      (message "Saved into tar-buffer `%s'.  Be sure to save that buffer!"
  	     (buffer-name tar-superior-buffer))
      ;; Prevent ordinary saving from happening.
!     t)))
  
  
  (defun tar-pad-to-blocksize ()
--- 1181,1193 ----
  	(tar-pad-to-blocksize))
         (narrow-to-region 1 tar-header-offset)))
      (set-buffer-modified-p t)   ; mark the tar file as modified
!     (kill-buffer tmp-buf)       ;;; patch for mule by yagi
!     (set-buffer cur-buf)        ;;; patch for mule by yagi
      (set-buffer-modified-p nil) ; mark the tar subfile as unmodified
      (message "Saved into tar-buffer `%s'.  Be sure to save that buffer!"
  	     (buffer-name tar-superior-buffer))
      ;; Prevent ordinary saving from happening.
!     t))))
  
  
  (defun tar-pad-to-blocksize ()