From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: auto-coding-function for LaTeX Date: Sat, 13 Nov 2004 16:14:51 +0200 Organization: JURTA Message-ID: <8765496dk4.fsf@jurta.org> References: <87u0ryah75.fsf@seamus.arnested.dk> <87654coxm9.fsf@jurta.org> <87654ct2zi.fsf@seamus.arnested.dk> <87y8h8rlbs.fsf@seamus.arnested.dk> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1100355460 13280 80.91.229.6 (13 Nov 2004 14:17:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 13 Nov 2004 14:17:40 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 13 15:17:25 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CSyiS-0004aE-00 for ; Sat, 13 Nov 2004 15:17:24 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CSyr4-0001cu-1Z for ged-emacs-devel@m.gmane.org; Sat, 13 Nov 2004 09:26:18 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CSyqw-0001cp-Bx for emacs-devel@gnu.org; Sat, 13 Nov 2004 09:26:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CSyqv-0001cd-UU for emacs-devel@gnu.org; Sat, 13 Nov 2004 09:26:10 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CSyqv-0001ca-RB for emacs-devel@gnu.org; Sat, 13 Nov 2004 09:26:09 -0500 Original-Received: from [66.33.205.9] (helo=spatula.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CSyiB-0004QY-BK for emacs-devel@gnu.org; Sat, 13 Nov 2004 09:17:07 -0500 Original-Received: from mail.jurta.org (80-235-37-219-dsl.mus.estpak.ee [80.235.37.219]) by spatula.dreamhost.com (Postfix) with ESMTP id A3D7A17D025; Sat, 13 Nov 2004 06:17:01 -0800 (PST) Original-To: =?utf-8?q?Arne_J=C3=B8rgensen?= In-Reply-To: <87y8h8rlbs.fsf@seamus.arnested.dk> (Arne =?utf-8?q?J=C3=B8rgensen's?= message of "Fri, 12 Nov 2004 00:56:55 +0100") User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) 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: main.gmane.org gmane.emacs.devel:29796 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:29796 Arne J=C3=B8rgensen writes: > I look a bit more in to it. And it actually seems more reasonable to > put the function (slightly changed) into `file-coding-system-alist'. > [...] > (add-to-list 'file-coding-system-alist '("\\.tex\\|\\.ltx\\'" . latex-fin= d-file-coding-system)) I think this is not the most right thing to do since there may be LaTeX file extensions other than .tex and .ltx. The standard value of `auto-mode-alist' has also .sty, .cl[so], .bbl as file extensions corresponding to latex-mode. And users can add own mappings to `auto-mode-alist' or use `-*- mode:latex -*-' headers. In that case `file-coding-system-alist' wouldn't work. > The function is being called with an argument (arg) but I don't know > what I'm supposed to do with the argument so I ignore it at the > moment. `arg' is a list (operation, file-name, ...). For an example of using it, you could look at the file textmodes/po.el which is completely devoted to setting correct encoding for PO files according to the "Charset=3D..." header. Perhaps this file should be generalized to support more file types like you want to do for LaTeX files with `inputenc' cookie. --=20 Juri Linkov http://www.jurta.org/emacs/