From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.devel Subject: Re: auto-coding-function for LaTeX Date: Fri, 12 Nov 2004 02:12:27 +0100 Message-ID: References: <87u0ryah75.fsf@seamus.arnested.dk> <87654coxm9.fsf@jurta.org> <87654ct2zi.fsf@seamus.arnested.dk> <87y8h8rlbs.fsf@seamus.arnested.dk> Reply-To: Reiner Steib NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1100221999 9812 80.91.229.6 (12 Nov 2004 01:13:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 12 Nov 2004 01:13:19 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 12 02:13:01 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 1CSPzo-0005W6-00 for ; Fri, 12 Nov 2004 02:13:01 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CSQ8L-0001Pp-GS for ged-emacs-devel@m.gmane.org; Thu, 11 Nov 2004 20:21:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CSQ88-0001NG-6z for emacs-devel@gnu.org; Thu, 11 Nov 2004 20:21:36 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CSQ86-0001MQ-6H for emacs-devel@gnu.org; Thu, 11 Nov 2004 20:21:34 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CSQ85-0001Li-G7 for emacs-devel@gnu.org; Thu, 11 Nov 2004 20:21:33 -0500 Original-Received: from [134.60.1.1] (helo=mail-new.rz.uni-ulm.de) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CSPzL-0006rv-48 for emacs-devel@gnu.org; Thu, 11 Nov 2004 20:12:31 -0500 Original-Received: from lumberjack.physik.uni-ulm.de (lumberjack.physik.uni-ulm.de [134.60.10.173]) by mail.uni-ulm.de (8.13.1/8.13.1) with ESMTP id iAC1CSI4013123; Fri, 12 Nov 2004 02:12:28 +0100 (MET) Original-Received: by lumberjack.physik.uni-ulm.de (Postfix, from userid 170) id 1D7BE1817E; Fri, 12 Nov 2004 02:12:28 +0100 (CET) Mail-Followup-To: =?iso-8859-1?q?Arne_J=F8rgensen?= , emacs-devel@gnu.org Original-To: =?iso-8859-1?q?Arne_J=F8rgensen?= X-Face: 'bg&jY[8V'W&:=~6w"|>}#4/T; w~36ei4NNMyKRR.a$n=$|sWFPF1y]a\>6kc\*#GN]UDM| Ywv, vbL^XF1nIp\:F=$Ei2o&mEe:%N~, :3]vtQ~s9u$9izmX$IF@VgGl7/, ^dbuM<3|AO2}.%|%?kZ 2Y=@\U!~cll^=8Z9ihKq%wmUe1Ky(#kl3T'>Qk0Ia3mCBsTk?E(,X In-Reply-To: <87y8h8rlbs.fsf@seamus.arnested.dk> (Arne =?iso-8859-1?q?J=F8rgensen's?= message of "Fri, 12 Nov 2004 00:56:55 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) X-DCC-RollaNet-Metrics: gemini 1004; Body=2 Fuz1=2 Fuz2=2 X-MIME-Autoconverted: from 8bit to quoted-printable by mail.uni-ulm.de id iAC1CSI4013123 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:29771 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:29771 On Fri, Nov 12 2004, Arne J=F8rgensen wrote: > It could look like this: [...] I have added some other coding systems available in Emacs and I tried to improve the code and doc-strings. WDYT? --8<---------------cut here---------------start------------->8--- (defcustom latex-auto-coding-alist '(("ansinew" . windows-1252) ; MS Windows ANSI encoding, extension of L= atin-1 ("applemac" . mac-roman) ("ascii" . us-ascii) ("cp1250" . cp1250) ; MS Windows encoding, codepage 1250 ("cp1252" . windows-1252) ; synonym of ansinew ("cp437de" . cp437) ; IBM code page 437 (German version): 225 is \ss ("cp437" . cp437) ; IBM code page 437: 225 is \beta ("cp850" . cp850) ; IBM code page 850 ("cp852" . cp852) ; IBM code page 852 ("cp865" . cp865) ; IBM code page 865 ;; The DECMultinational charaterset used by the OpenVMS system ;; ("decmulti" . undecided) ("latin1" . iso-8859-1) ("latin2" . iso-8859-2) ("latin3" . iso-8859-3) ("latin4" . iso-8859-4) ("latin5" . iso-8859-5) ("latin9" . iso-8859-15) ;; ("next" . undecided) ; The Next encoding ("utf8" . utf-8)) "Mapping from encoding names used by \"inputenc.sty\" Emacs coding syst= ems. Used by the function `latex-auto-coding-function'." :group 'mule :type '(alist :key-type (string :tag "LaTeX input encoding") :value-type (coding-system :tag "Coding system"))) (defun latex-find-file-coding-system (arg) "Determine the encoding of a LaTeX buffer if it uses \"inputenc.sty\". This function is intended to be added to `auto-coding-functions'. The mapping from LaTeX's \"inputenc.sty\" encoding names to Emacs coding system names is determined from `latex-auto-coding-alist'." (when (re-search-forward "\\usepackage\\[\\(.*\\)\\]{inputenc}" 1000 t) (let* ((match (match-string 1)) (inputenc-match (cdr (assoc match latex-auto-coding-alist))) (sym (intern match))) (when inputenc-match (setq sym inputenc-match)) (when (coding-system-p sym) sym)))) (add-to-list 'file-coding-system-alist '("\\.tex\\|\\.ltx\\'" . latex-find-file-coding-system)) --8<---------------cut here---------------end--------------->8--- Bye, Reiner. --=20 ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/