From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vincent Lefevre Newsgroups: gmane.emacs.devel Subject: Re: Should `auto-coding-functions' be mode-specific? Date: Wed, 3 Jan 2007 13:09:01 +0100 Message-ID: <20070103120901.GC3554@vin.lip.ens-lyon.fr> References: <87ejqd88iv.fsf@pacem.orebokech.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1167847132 1625 80.91.229.12 (3 Jan 2007 17:58:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 3 Jan 2007 17:58:52 +0000 (UTC) Cc: Romain Francoise , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 03 18:58:49 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 1H2ANo-0001wZ-Sf for ged-emacs-devel@m.gmane.org; Wed, 03 Jan 2007 18:58:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H2ANo-00035h-GJ for ged-emacs-devel@m.gmane.org; Wed, 03 Jan 2007 12:58:36 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H24vh-000549-OD for emacs-devel@gnu.org; Wed, 03 Jan 2007 07:09:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H24vg-00052g-KY for emacs-devel@gnu.org; Wed, 03 Jan 2007 07:09:13 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H24vg-00052U-Dz for emacs-devel@gnu.org; Wed, 03 Jan 2007 07:09:12 -0500 Original-Received: from [140.77.167.16] (helo=pilet.ens-lyon.fr) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H24vb-0005cb-UT; Wed, 03 Jan 2007 07:09:08 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by pilet.ens-lyon.fr (Postfix) with ESMTP id B849215B827; Wed, 3 Jan 2007 13:09:06 +0100 (CET) Original-Received: from pilet.ens-lyon.fr ([127.0.0.1]) by localhost (pilet [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 20487-51; Wed, 3 Jan 2007 13:09:02 +0100 (CET) Original-Received: from vin.lip.ens-lyon.fr (vin.lip.ens-lyon.fr [140.77.13.170]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by pilet.ens-lyon.fr (Postfix) with ESMTP id C6E7F15B904; Wed, 3 Jan 2007 13:09:01 +0100 (CET) Original-Received: from vlefevre by vin.lip.ens-lyon.fr with local (Exim 4.63 #1 (Debian)) id 1H24vV-00026d-NE; Wed, 03 Jan 2007 13:09:01 +0100 Original-To: Richard Stallman Mail-Followup-To: Vincent Lefevre , Richard Stallman , Romain Francoise , emacs-devel@gnu.org Content-Disposition: inline In-Reply-To: X-Mailer-Info: http://www.vinc17.org/mutt/ User-Agent: Mutt/1.5.13-vl-r14963 (2007-01-02) X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ens-lyon.fr X-Mailman-Approved-At: Wed, 03 Jan 2007 12:58:24 -0500 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:64694 Archived-At: On 2007-01-02 22:34:55 -0500, Richard Stallman wrote: > Emacs examines these parts of the file to determine the coding system > before it reads the whole file, so it can use the chosen coding system > to do the reading. Choosing the major mode comes later, after reading > the whole file. This explains the problem. But anyway, there was some text before the HTML code, meaning that the HTML code was included in some text file. So, in this case, I don't think taking the charset from the META header is a correct behavior. > but the submitter argues that the functions to get the > encoding from the file's contents should only be enabled in modes > where the content of the buffer is supposed to match -- i.e. don't > use the META header function in buffers that aren't in html-mode (o= r > equivalent). >=20 > It does sound more correct, but given the order in which things > are done, it would be very difficult. Couldn't a second pass be performed? --=20 Vincent Lef=E8vre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)