emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: auto-coding-function for LaTeX


From: Juri Linkov
Subject: Re: auto-coding-function for LaTeX
Date: Sat, 13 Nov 2004 16:14:51 +0200
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

Arne Jørgensen <address@hidden> 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-find-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=..." header.

Perhaps this file should be generalized to support more file types
like you want to do for LaTeX files with `inputenc' cookie.

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]