From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Emil Hedevang Lohse Newsgroups: gmane.emacs.help Subject: Re: Plain TeX mode Date: Thu, 04 Dec 2003 07:57:58 +0100 Organization: Gul and Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <87he0iejv1.fsf@mrbun.watterson> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1070521554 4915 80.91.224.253 (4 Dec 2003 07:05:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 4 Dec 2003 07:05:54 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 04 08:05:51 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ARnYd-0004YQ-00 for ; Thu, 04 Dec 2003 08:05:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ARoQC-0001WY-2w for geh-help-gnu-emacs@m.gmane.org; Thu, 04 Dec 2003 03:01:12 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsmi-us.news.garr.it!newsmi-eu.news.garr.it!NewsITBone-GARR!feed.news.tiscali.de!uninett.no!news.net.uni-c.dk!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 62 Original-NNTP-Posting-Host: legolas.imf.au.dk Original-X-Trace: news.net.uni-c.dk 1070520782 1720 130.225.20.14 (4 Dec 2003 06:53:02 GMT) Original-X-Complaints-To: usenet@news.net.uni-c.dk Original-NNTP-Posting-Date: Thu, 4 Dec 2003 06:53:02 +0000 (UTC) User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/20.7 (gnu/linux) Cancel-Lock: sha1:248oeG8SNxYR+zbaBEvSsqibsuk= Original-Xref: shelby.stanford.edu gnu.emacs.help:118985 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:14926 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:14926 Stefan Monnier writes: >> Having successfully gotten an answer I will try to ask another >> question: I write a lot in danish where we have the letters æ, ø, >> å, Æ, Ø, Å (in Plain TeX: \ae, \o, \aa, etc.). I do >> known how to make TeX understand them directly, but I would also >> like Emacs to properly colour my macro names. Currently "\red" is >> coloured light blue; but with "\rød" the backslash and "r" are >> colored light blue but the "ø" and "d" are not. Is there some way >> I can tell Emacs to include these letters into its colour coding >> mechanism? > > Change the font-lock-keywords patterns. > It's not very convenient, tho. Can I get a hint on how to do that? > But I'm wondering: does TeX understand such a macro name (i.e. does > it consider ø to be a letter that can be used inside a macro name) > ? If it does, then your problem is not just a preference but a bug > which I should fix. Not out of the box. Every character of category code 11 (for example the letters a-z and A-Z) can be used as a part of a macro name. Other characters are of category code 12 unless they are not, that is, unless they have been given another category code. If I recall correctly (by looking on page 37 of the TeXbook) Plain TeX has the following assignments of category codes: \ 0 { 1 } 2 $ 3 & 4 5 # 6 ^ 7 _ 8 9 10 a-z and A-Z 11 <--- Usable in a macro name. other 12 ~ 13 % 14 15 So the characters æøåÆØÅäéöüÄÉÖÜ and so on are of category code 12 and therefore cannot be a part of a macro name. But by saying \catcode`æ=11 I change the category code of æ and henceforth I am able to use æ in a macro name. This is convenient if I would like to give the macros Danish names and if I do not care about portability. Regards, -- Emil Hedevang Lohse Alle spørgsmål er lige dumme. Og spørgsmålet "Kan ænder flyve?" er ikke dumt.