From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.emacs.devel Subject: Re: po file charset via auto-coding-functions Date: Sat, 22 Oct 2005 07:07:55 +1000 Message-ID: <87k6g6bmtw.fsf@zip.com.au> References: <87zmp399ue.fsf@zip.com.au> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1129929007 23828 80.91.229.2 (21 Oct 2005 21:10:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 21 Oct 2005 21:10:07 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 21 23:09:57 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ET47g-0000bm-LS for ged-emacs-devel@m.gmane.org; Fri, 21 Oct 2005 23:08:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ET47e-0002hJ-M1 for ged-emacs-devel@m.gmane.org; Fri, 21 Oct 2005 17:08:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ET47R-0002go-14 for emacs-devel@gnu.org; Fri, 21 Oct 2005 17:08:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ET47Q-0002gM-6Q for emacs-devel@gnu.org; Fri, 21 Oct 2005 17:08:04 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ET47P-0002gG-Va for emacs-devel@gnu.org; Fri, 21 Oct 2005 17:08:04 -0400 Original-Received: from [61.8.0.115] (helo=mailout2.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ET47O-0000la-Iq for emacs-devel@gnu.org; Fri, 21 Oct 2005 17:08:03 -0400 Original-Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86]) by mailout2.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id j9LL80S7028272 for ; Sat, 22 Oct 2005 07:08:00 +1000 Original-Received: from localhost (ppp2495.dyn.pacific.net.au [61.8.36.149]) by mailproxy1.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id j9LL7wCp008681 for ; Sat, 22 Oct 2005 07:07:59 +1000 Original-Received: from gg by localhost with local (Exim 3.36 #1 (Debian)) id 1ET47H-0000ho-00; Sat, 22 Oct 2005 07:07:55 +1000 Original-To: emacs-devel@gnu.org In-Reply-To: (Richard M. Stallman's message of "Fri, 21 Oct 2005 00:49:46 -0400") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) 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:44530 Archived-At: "Richard M. Stallman" writes: > > 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 tried this (in my build of the cvs starting from -q -no-site-file), (debug-on-entry 'sgml-html-meta-auto-coding-function) (find-file "etc/NEWS") ;; the emacs NEWS file and got Debugger entered--entering a function: * sgml-html-meta-auto-coding-function(580713) byte-code("\212eb\210^H\211A^P@ !)\207" [funcs size] 2) find-auto-coding("/down/emacs/etc/NEWS" 580713) set-auto-coding("/down/emacs/etc/NEWS" 580713) insert-file-contents("/down/emacs/etc/NEWS" t) ie. the size presented to the func (in just one call to it) is the full 580kbytes (and the current-buffer has the full file contents). So, like I say, I was unsure when this does or doesn't happen. > 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. Looking at more than 1k of the file will also be wanted for Project Gutenberg texts. They have about a ~1k blurb at the start before the header information that has the coding system spec.