[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: EOL conversion of files in .tar archives
From: |
Kenichi Handa |
Subject: |
Re: EOL conversion of files in .tar archives |
Date: |
Mon, 21 May 2007 13:48:20 +0900 |
User-agent: |
SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.0 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
In article <address@hidden>, Eli Zaretskii <address@hidden> writes:
> Lately I noticed that, in the Windows port of Emacs, visiting files in
> .tar archives shows them as if they had DOS EOLs, even though the
> files have Unix EOLs. (This is not due to some recent change: it
> looks like Emacs behaved like that since before the pretest.)
> Is this intentional, or should I debug it? If the former, can someone
> explain the rationale?
I think it is a bug of find-buffer-file-type-coding-system
(dos-w32.el). If TARGET is (FILENAME . BUFFER), it should
assume that the file contents is available. Could you
verify that the attached patch is correct?
---
Kenichi Handa
address@hidden
*** dos-w32.el 24 Apr 2007 15:08:02 +0900 1.45
--- dos-w32.el 21 May 2007 13:43:47 +0900
***************
*** 129,135 ****
(let ((op (nth 0 command))
(target)
(binary nil) (text nil)
! (undecided nil) (undecided-unix nil))
(cond ((eq op 'insert-file-contents)
(setq target (nth 1 command))
;; If TARGET is a cons cell, it has the form (FILENAME . BUFFER),
--- 129,135 ----
(let ((op (nth 0 command))
(target)
(binary nil) (text nil)
! (undecided nil) (undecided-unix nil) (buffer nil))
(cond ((eq op 'insert-file-contents)
(setq target (nth 1 command))
;; If TARGET is a cons cell, it has the form (FILENAME . BUFFER),
***************
*** 138,144 ****
;; arguments is used, e.g., in arc-mode.el.) This function
;; doesn't care about the contents, it only looks at the file's
;; name, which is the CAR of the cons cell.
! (if (consp target) (setq target (car target)))
;; First check for a file name that indicates
;; it is truly binary.
(setq binary (find-buffer-file-type target))
--- 138,144 ----
;; arguments is used, e.g., in arc-mode.el.) This function
;; doesn't care about the contents, it only looks at the file's
;; name, which is the CAR of the cons cell.
! (if (consp target) (setq buffer (cdr target) target (car target)))
;; First check for a file name that indicates
;; it is truly binary.
(setq binary (find-buffer-file-type target))
***************
*** 147,153 ****
((find-buffer-file-type-match target)
(setq text t))
;; For any other existing file, decide based on contents.
! ((file-exists-p target)
(setq undecided t))
;; Next check for a non-DOS file system.
((untranslated-file-p target)
--- 147,153 ----
((find-buffer-file-type-match target)
(setq text t))
;; For any other existing file, decide based on contents.
! ((or buffer (file-exists-p target))
(setq undecided t))
;; Next check for a non-DOS file system.
((untranslated-file-p target)