From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Should `auto-coding-functions' be mode-specific? Date: Sun, 07 Jan 2007 18:22:57 +0200 Organization: JURTA Message-ID: <87mz4ux0v2.fsf@jurta.org> References: <87ejqd88iv.fsf@pacem.orebokech.com> <87irfn5ggf.fsf@pacem.orebokech.com> <8764bkeydx.fsf@jurta.org> <87k5zzq781.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 1168187837 24703 80.91.229.12 (7 Jan 2007 16:37:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 7 Jan 2007 16:37:17 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 07 17:37:13 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 1H3b1A-0005kn-Dz for ged-emacs-devel@m.gmane.org; Sun, 07 Jan 2007 17:37:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H3b19-0004n9-U0 for ged-emacs-devel@m.gmane.org; Sun, 07 Jan 2007 11:37:07 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H3b0u-0004mj-BE for emacs-devel@gnu.org; Sun, 07 Jan 2007 11:36:52 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H3b0q-0004in-Ji for emacs-devel@gnu.org; Sun, 07 Jan 2007 11:36:52 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H3b0q-0004ie-Em for emacs-devel@gnu.org; Sun, 07 Jan 2007 11:36:48 -0500 Original-Received: from [62.64.120.200] (helo=relay01.kiev.sovam.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1H3b0p-0007HF-U6 for emacs-devel@gnu.org; Sun, 07 Jan 2007 11:36:48 -0500 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay01.kiev.sovam.com with esmtp (Exim 4.60) (envelope-from ) id 1H3b0f-000ERZ-Qw for emacs-devel@gnu.org; Sun, 07 Jan 2007 18:36:46 +0200 Original-To: emacs-devel@gnu.org In-Reply-To: <87k5zzq781.fsf@pacem.orebokech.com> (Romain Francoise's message of "Sun, 07 Jan 2007 14:47:26 +0100") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.90 (gnu/linux) X-Scanner-Signature: 8abf2c83e696415c40c55866f9369f42 X-DrWeb-checked: yes X-SpamTest-Envelope-From: juri@jurta.org X-SpamTest-Group-ID: 00000000 X-SpamTest-Info: Profiles 661 [Dec 30 2006] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {received from trusted relay: not dialup} X-SpamTest-Method: none X-SpamTest-Method: Local Lists X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release 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:64921 Archived-At: >> But then why not to go further and use the same regexp as used for >> detecting HTML files in `magic-mode-alist'? It seems reasonable >> to detect the HTML encoding exactly in the same files that later >> recognized as HTML according to the file contents. > > I think it's a good idea, and it is easy to do (see below). > But it would reopen your original issue: that encoding detection > doesn't work in Mozilla bookmark files. Mozilla bookmark files get detected as SGML according to the sgml-mode rule in magic-mode-alist. This is ok to visit Mozilla bookmark files in SGML mode, since these are not quite HTML files, but nonetheless we should try to detect their encoding. We either could create a new function sgml-meta-auto-coding-function (like sgml-html-meta-auto-coding-function), or add encoding detection of HTML-like SGML files to sgml-html-meta-auto-coding-function by fetching and applying the sgml-mode rule as well as html-mode rule from magic-mode-alist. -- Juri Linkov http://www.jurta.org/emacs/