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: Should `auto-coding-functions' be mode-specific? Date: Tue, 02 Jan 2007 22:34:55 -0500 Message-ID: References: <87ejqd88iv.fsf@pacem.orebokech.com> Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1167795336 13872 80.91.229.12 (3 Jan 2007 03:35:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 3 Jan 2007 03:35:36 +0000 (UTC) Cc: vincent@vinc17.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 03 04:35:32 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 1H1wuW-0000v4-7l for ged-emacs-devel@m.gmane.org; Wed, 03 Jan 2007 04:35:28 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H1wuV-0000Uj-JU for ged-emacs-devel@m.gmane.org; Tue, 02 Jan 2007 22:35:27 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H1wuK-0000UQ-Nw for emacs-devel@gnu.org; Tue, 02 Jan 2007 22:35:16 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H1wuK-0000UE-AV for emacs-devel@gnu.org; Tue, 02 Jan 2007 22:35:16 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H1wuK-0000UB-7O for emacs-devel@gnu.org; Tue, 02 Jan 2007 22:35:16 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H1wuJ-0007Cs-VF for emacs-devel@gnu.org; Tue, 02 Jan 2007 22:35:16 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1H1wtz-0007DZ-5Z; Tue, 02 Jan 2007 22:34:55 -0500 Original-To: Romain Francoise In-reply-to: <87ejqd88iv.fsf@pacem.orebokech.com> (message from Romain Francoise on Tue, 02 Jan 2007 21:43:04 +0100) 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:64669 Archived-At: The file itself is not an HTML file, but Emacs still uses the encoding specified in the HTML code to set the encoding. (This is caused by `sgml-html-meta-auto-coding-function', which is present by default in the list of `auto-coding-functions' -- the functions are tried in the first 1K or last 3K bytes of the buffer.) 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. 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 (or equivalent). It does sound more correct, but given the order in which things are done, it would be very difficult.