From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Gerald Wildgruber Newsgroups: gmane.emacs.help Subject: auto-recognize utf-8 encoded files upon visiting: solved (sort of...) Date: 24 Sep 2002 13:45:22 +0200 Organization: T-Online Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: Reply-To: Gerald Wildgruber NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1032869180 8899 127.0.0.1 (24 Sep 2002 12:06:20 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 24 Sep 2002 12:06:20 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17toSI-0002JG-00 for ; Tue, 24 Sep 2002 14:06:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17toSL-00078d-00; Tue, 24 Sep 2002 08:06:21 -0400 Original-Path: shelby.stanford.edu!nntp.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!kibo.news.demon.net!demon!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 48 Original-X-Trace: news.t-online.com 1032868143 00 19925 jYwxbF3ESQAKPP 020924 11:49:03 Original-X-Complaints-To: abuse@t-online.com X-Sender: 520037909364-0001@t-dialin.net User-Agent: Gnus/5.090003 (Oort Gnus v0.03) Emacs/21.3.50 Original-Xref: nntp.stanford.edu gnu.emacs.help:105227 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:1782 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:1782 Thanks to everybody who helped answering my question! What I was trying to do was to make emacs auto-recognize utf-8 encoded files upon visiting. In the beginning, it didn't. The problem seems to have been that -- latin-9 being my primary language environment -- utf-8 only appeared at the end of my priority list for encodings. Emacs then seems to take my utf-8 file as beeing encoded in one of the prior coding entries of the priority list (probably as one of the iso-2022 family). Seems to be an erroneous recognition. Letters beyond ascii are messed up then. I didn't want utf-8 to be on the first place of the priority list (because then all newly cereated files then have it as their default encoding), but neither on the last one. If you do a double M-x prefer-coding-system, the first time with utf-8, the second time with latin-9 as the value, utf is promoted to the second place of the priority list, latin-9 remains on the first place. Now without any explicit indication of the encoding (e.g. via file variables) emacs correctly recognizes the encoding, when I'm visiting utf-8 files. To achieve this entry order in the priority list PERMANENTLY I simply put the following two lines, in this order, into my init file: (prefer-coding-system 'utf-8) (prefer-coding-system 'latin-9) I'm sure there is a cleaner and more elegant solution, but it kind of works. Last remark: Charles, thanks for your hint on TEI; I gave TEI a long try many years ago, when SGML came up, they provided very good introductory material to the whole issue. But I didn't know of their work on emacs. You say that the unicode stuff didn't work right on emacs 21.2. I compiled an emacs version from the CVS sources (http://savannah.gnu.org/projects/emacs/) and there unicode integration seems to be already more evolved than in the official distribution. Almost everything works very well. Perhaps you should give it a try. I'm also working with different languages (cl.greek) and I am very happy with the evolving unicode capabilities of emacs. I think unicode integration is THE way by which emacs stops being merely a tool for programmers and addresses a wider audience also in the humanities. Gerald.