From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Richard M. Stallman" Newsgroups: gmane.emacs.devel Subject: Re: po file charset via auto-coding-functions Date: Fri, 21 Oct 2005 00:49:46 -0400 Message-ID: References: <87zmp399ue.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 1129870330 1999 80.91.229.2 (21 Oct 2005 04:52:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 21 Oct 2005 04:52:10 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 21 06:52:09 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ESorO-0000cg-1P for ged-emacs-devel@m.gmane.org; Fri, 21 Oct 2005 06:50:31 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ESorN-0004Zp-7x for ged-emacs-devel@m.gmane.org; Fri, 21 Oct 2005 00:50:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ESoqj-0004CK-81 for emacs-devel@gnu.org; Fri, 21 Oct 2005 00:49:49 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ESoqi-0004Bz-KC for emacs-devel@gnu.org; Fri, 21 Oct 2005 00:49:48 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ESoqi-0004Bu-E6 for emacs-devel@gnu.org; Fri, 21 Oct 2005 00:49:48 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ESoqi-0005Px-Nz for emacs-devel@gnu.org; Fri, 21 Oct 2005 00:49:48 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1ESoqg-0002pG-7v; Fri, 21 Oct 2005 00:49:46 -0400 Original-To: Kevin Ryde In-reply-to: <87zmp399ue.fsf@zip.com.au> (message from Kevin Ryde on Fri, 21 Oct 2005 07:06:49 +1000) 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:44475 Archived-At: One possible problem is that po files can have more than 1024 bytes of comments before the header info block. I see fileio.c Finsert_file_contents only grabs 1024 bytes before calling set-auto-coding, but I can't tell if/when that happens. I think it ALWAYS happens. Every call to Finsert_file_contents will try to determine the coding system from the first 1k and last 3k of the file. (Unless it already knows the coding system to use.) I think a normal visit or an `archive-extract' has the whole file, so they work. If Finsert_file_contents can't determine the coding system from that part of the file, then if it is a normal visit (or if the buffer was previously empty), it will try again after reading all the file. So I guess this will work ok in that case. But if it is inserting the file into a buffer that had other text in it, or if it is inserting just part of the file, I think it won't work. To make it work reliably, therefore, I think the Vset_auto_coding_function function has to look at more of the file. If it is looking at a po file, it should do that. This should not be too hard, since it gets the file name as an argument.