From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: EOL conversion of files in .tar archives Date: Wed, 23 May 2007 14:58:16 +0900 Message-ID: References: <87abvwrzwz.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1179899925 20255 80.91.229.12 (23 May 2007 05:58:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 23 May 2007 05:58:45 +0000 (UTC) Cc: eliz@gnu.org, emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 23 07:58:42 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hqjrt-0002km-Qb for ged-emacs-devel@m.gmane.org; Wed, 23 May 2007 07:58:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hqjru-0006pz-BU for ged-emacs-devel@m.gmane.org; Wed, 23 May 2007 01:58:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hqjrr-0006nm-HJ for emacs-devel@gnu.org; Wed, 23 May 2007 01:58:39 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hqjrq-0006lH-6n for emacs-devel@gnu.org; Wed, 23 May 2007 01:58:39 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hqjrp-0006kq-Tz for emacs-devel@gnu.org; Wed, 23 May 2007 01:58:37 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Hqjrk-0007rk-W0; Wed, 23 May 2007 01:58:34 -0400 Original-Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id l4N5wHvE005180; Wed, 23 May 2007 14:58:20 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp3.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id l4N5wHwT003852; Wed, 23 May 2007 14:58:17 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp3.aist.go.jp with ESMTP id l4N5wGSe014593; Wed, 23 May 2007 14:58:16 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken.m17n.org with local (Exim 4.63) (envelope-from ) id 1HqjrU-0007TF-HM; Wed, 23 May 2007 14:58:16 +0900 In-reply-to: <87abvwrzwz.fsf@stupidchicken.com> (message from Chong Yidong on Tue, 22 May 2007 23:18:04 -0400) 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) X-detected-kernel: Solaris 8 (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:71641 Archived-At: In article <87abvwrzwz.fsf@stupidchicken.com>, Chong Yidong writes: > Eli Zaretskii writes: > > > > This solves the problem with the EOL decoding, but reveals a very > > strange phenomenon: dos-w32.el and dos-w32.elc behave differently. > > ... > > - (set-buffer-file-coding-system coding)) > > + (set-buffer-file-coding-system last-coding-system-used t)) > What's the rationale for this change? The purpose of the old code was > quite transparent; changing it to use last-coding-system-used is not > obvious, and deserves at least a comment. I think that change is to fix a bug of original code that has not been unveiled in non-Windows system. We have this code now: (if coding (or (numberp (coding-system-eol-type coding)) (vectorp (coding-system-eol-type detected)) (setq coding (coding-system-change-eol-conversion coding (coding-system-eol-type detected)))) -> (setq coding -> (find-new-buffer-file-coding-system detected))) In non-Windows system, usually the last two lines are executed, thus DETECTED is reflected in CODING by find-new-buffer-file-coding-system. So, (set-buffer-file-coding-system coding) is ok. But, if that part is not executed and CODING is something like undecided-dos, even if decode-coding itself detects a coding system, the detected one is not reflected in buffer-file-coding-system. For instance, even on GNU/Linux, if a tar file contains a Latin-1 file "temp.dos", and we have this setting, (push '("\\.dos\\'" . undecided-dos) file-coding-system-alist) Buffer-file-coding-system of "temp.dos" will be undecided-dos, instead of latin-1-*. > (And I think the use of last-coding-system-used leads to > the "strange phenomenon" mentioned above.) I think it is very unlikely that it is so. But... > All this makes me more dubious about adding this code now. We should > either make this entire change conditional on win32 (hedious as the > resulting code might be) or simply postphone it for Emacs 22.2. if we are going to include that change in Emacs 22.1, it seems that making the change conditional is a good idea. --- Kenichi Handa handa@m17n.org