From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Romain Francoise Newsgroups: gmane.emacs.devel Subject: Should `auto-coding-functions' be mode-specific? Date: Tue, 02 Jan 2007 21:43:04 +0100 Organization: orebokech dot com Message-ID: <87ejqd88iv.fsf@pacem.orebokech.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1167770686 8837 80.91.229.12 (2 Jan 2007 20:44:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 2 Jan 2007 20:44:46 +0000 (UTC) Cc: Vincent Lefevre Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 02 21:44:43 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 1H1qUl-0006KO-Oq for ged-emacs-devel@m.gmane.org; Tue, 02 Jan 2007 21:44:32 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H1qUY-00032o-LL for ged-emacs-devel@m.gmane.org; Tue, 02 Jan 2007 15:44:14 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H1qSl-00028O-G8 for emacs-devel@gnu.org; Tue, 02 Jan 2007 15:42:23 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H1qSj-00027i-V7 for emacs-devel@gnu.org; Tue, 02 Jan 2007 15:42:23 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H1qSj-00027d-Nm for emacs-devel@gnu.org; Tue, 02 Jan 2007 15:42:21 -0500 Original-Received: from [82.67.41.165] (helo=yeast.orebokech.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H1qSi-0004L9-Us for emacs-devel@gnu.org; Tue, 02 Jan 2007 15:42:21 -0500 Original-Received: from pacem.orebokech.com (pacem.orebokech.com [192.168.1.3]) by yeast.orebokech.com (Postfix) with ESMTP id 36F1712C3B; Tue, 2 Jan 2007 21:42:20 +0100 (CET) Original-Received: by pacem.orebokech.com (Postfix, from userid 1000) id 97E6D5269A; Tue, 2 Jan 2007 21:43:04 +0100 (CET) Original-To: emacs-devel@gnu.org X-Face: }9mYu,e_@+e!`Z-P5kVXa3\_b:hdJ"B)ww[&=b<2=awG:GOIM 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:64643 Archived-At: I received a bug report from a Debian user (CC'd) who was surprised to see that Emacs 22 opens one of his utf-8-encoded files as ASCII, because it contains the following HTML snippet near the top: | | | | | | 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.) I replied that the encoding can be forced using a -*- coding: .. -*- cookie, 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). What do people think? (See http://bugs.debian.org/404236 for the discussion.) -- Romain Francoise | The sea! the sea! the open it's a miracle -- http://orebokech.com/ | sea! The blue, the fresh, the | ever free! --Bryan W. Procter