From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: po file charset via auto-coding-functions Date: Wed, 02 Nov 2005 05:27:14 -0500 Message-ID: References: <87zmp399ue.fsf@zip.com.au> <87ll0ma3ow.fsf@zip.com.au> <87fyqu9ung.fsf@zip.com.au> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1130929109 6244 80.91.229.2 (2 Nov 2005 10:58:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 2 Nov 2005 10:58:29 +0000 (UTC) Cc: user42@zip.com.au, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 02 11:58:28 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EXGHm-000383-7v for ged-emacs-devel@m.gmane.org; Wed, 02 Nov 2005 11:56:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EXGHl-0008MT-MD for ged-emacs-devel@m.gmane.org; Wed, 02 Nov 2005 05:56:05 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EXFq5-00046S-Oi for emacs-devel@gnu.org; Wed, 02 Nov 2005 05:27:30 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EXFq2-000469-1g for emacs-devel@gnu.org; Wed, 02 Nov 2005 05:27:26 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EXFq1-000464-D3 for emacs-devel@gnu.org; Wed, 02 Nov 2005 05:27:25 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EXFq1-0004JZ-Fm for emacs-devel@gnu.org; Wed, 02 Nov 2005 05:27:25 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1EXFpq-0001Cq-9k; Wed, 02 Nov 2005 05:27:14 -0500 Original-To: Kenichi Handa In-Reply-To: (message from Kenichi Handa on Mon, 24 Oct 2005 11:05:06 +0900) 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:45288 Archived-At: [I sent this message a week ago but did not get a response. Could we get the discussion moving again?] The current problem is that on extracting vi.po in tar-mode, a function registered in file-coding-system-alist is called with a filename "vi.po". So, that function can't check the contents of that file because it can't read the contents by insert-file-contents. I see. The correct operation in a handler for insert-file-contents will be to find a buffer pretending to visit the file, and insert that buffer contents. And, for that, we have to give buffer-file-name (e.g. /home/handa/x.tgz!vi.po") not the filename itself (e.g. vi.po) to find-operation-coding-system. I think such a change is safe because, at least, all current entries in file-coding-system-alist checks only the tail of a filename. If this means passing "/home/handa/x.tgz!vi.po" as the second argument to find-operation-coding-system, I think it is not clean. That argument is documented to be _the same_ in meaning as the argument you would pass to OPERATION, but this string isn't the same, isn't a valid argument to insert-file-contents. If we want to modify the calling convention of find-operation-coding-system, we should do it in a cleaner way: by binding a global variable. That variable would be nil, normally. I think the variable's value should be a buffer name. If the variable is non-nil, it means "the file's contents are already in this buffer". And all the functions that handle find-operation-coding-system for various file types should check the variable. I think that is a fairly clean solution. What do you think?