From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: EOL conversion of files in .tar archives Date: Thu, 24 May 2007 11:32:56 +0300 Message-ID: References: <87abvwrzwz.fsf@stupidchicken.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1179995594 10464 80.91.229.12 (24 May 2007 08:33:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 24 May 2007 08:33:14 +0000 (UTC) Cc: emacs-devel@gnu.org To: Kenichi Handa Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 24 10:33:10 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 1Hr8kt-0007T1-Go for ged-emacs-devel@m.gmane.org; Thu, 24 May 2007 10:33:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hr8ku-0008Oo-U6 for ged-emacs-devel@m.gmane.org; Thu, 24 May 2007 04:33:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hr8kr-0008OB-4H for emacs-devel@gnu.org; Thu, 24 May 2007 04:33:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hr8kp-0008NS-Gj for emacs-devel@gnu.org; Thu, 24 May 2007 04:33:04 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hr8kp-0008NN-89 for emacs-devel@gnu.org; Thu, 24 May 2007 04:33:03 -0400 Original-Received: from nitzan.inter.net.il ([213.8.233.22]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Hr8kn-0004oO-PJ for emacs-devel@gnu.org; Thu, 24 May 2007 04:33:02 -0400 Original-Received: from HOME-C4E4A596F7 (IGLD-84-228-2-188.inter.net.il [84.228.2.188]) by nitzan.inter.net.il (MOS 3.7.3a-GA) with ESMTP id GUP80021 (AUTH halo1); Thu, 24 May 2007 11:32:55 +0300 (IDT) In-reply-to: (message from Kenichi Handa on Thu, 24 May 2007 17:15:23 +0900) X-detected-kernel: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) 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:71711 Archived-At: > From: Kenichi Handa > CC: emacs-devel@gnu.org > Date: Thu, 24 May 2007 17:15:23 +0900 > > > I'm uneasy with that change, because there are other places that use a > > cons cell as the second argument to find-operation-coding-system, and > > I'm not sure what you propose is good for them. For example, mule.el > > defines a utility function decode-coding-inserted-region that also > > uses a cons cell. (This utility function is currently used in > > jka-compr.el, pcvs.el and url-handlers.el.) Both it and its users are > > sufficiently complex that I couldn't easily decide whether the change > > you suggest will DTRT for them. Can you help me understand that? > > The docstring of find-operation-coding-system has this > paragraph. > > If operation is `insert-file-contents', the argument corresponding to > TARGET may be a cons (FILENAME . BUFFER). In that case, FILENAME is a > file name to look up, and BUFFER is a buffer that contains the file's > contents (not yet decoded). If `file-coding-system-alist' specifies a > function to call for FILENAME, that function should examine the > contents of BUFFER instead of reading the file. > > So, find-buffer-file-type-coding-system should handle > (FILENAME . BUFFER) as described above. Well, but it doesn't: it does NOT examine the contents of BUFFER at all; it relies on that to be done when it returns undecided. And that is the reason I asked the question about decode-coding-inserted-region: I'm not sure it will look at the region's contents to find the encoding, and neither am I sure what should be done in that context, since we are inserting only a portion of the buffer. So I'd still be happy to know whether your suggestion is not going to break decode-coding-inserted-region and its users. > That function has this code: > > ;; For any other existing file, decide based on contents. > ((file-exists-p target) > (setq undecided t)) > > If file-exists-p is used to check whether or not there > exists contents that can decide EOL type, isn't it TRT to > return undecided in (FILENAME . BUFFER) case. It's probably so, but I'm still not sure. Also, please note that returning undecided will cause the text encoding to be detected, not only the EOL type.