From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Tim Morley \(remove vegetable for email address\)" Newsgroups: gmane.emacs.help Subject: How easy to create new major mode? Date: Fri, 31 Jan 2003 15:47:46 +0100 Organization: Guest of France Telecom Oleane's newsreading service Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1044024556 2948 80.91.224.249 (31 Jan 2003 14:49:16 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 31 Jan 2003 14:49:16 +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 18ecTj-0000lN-00 for ; Fri, 31 Jan 2003 15:49:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18ecVJ-00089O-04 for gnu-help-gnu-emacs@m.gmane.org; Fri, 31 Jan 2003 09:50:53 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!oleane.net!oleane!nnrp.oleane.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 27 Original-NNTP-Posting-Host: 194.206.222.73 Original-X-Trace: s1.read.news.oleane.net 1044024389 28518 194.206.222.73 (31 Jan 2003 14:46:29 GMT) Original-X-Complaints-To: abuse@oleane.net Original-NNTP-Posting-Date: Fri, 31 Jan 2003 14:46:29 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Original-Xref: shelby.stanford.edu gnu.emacs.help:109642 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:6158 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:6158 Hi all. I believe the solution to my current emacs challenge will be to create a new major mode, albeit a very simple one. I'd be grateful for (a) confirmation that this is the way to attack the problem (or failing that, a better suggestion) and assuming this is indeed the case (b) guidance/URLs/code samples to help me put together what I need. What I would like to achieve is a customised system of syntax colouration, to help with reading through hundreds of lines of text. All I need is for lines starting with the word User to come up in, say, magenta, and lines starting with System in blue, with a default text colour of grey. (There are carriage-returns at the end of each line of text, so my keywords will always be at the beginning of a new line). I've had a look at the .el files for the various existing modes, but as an absolute novice in Lisp, I'm not sure which are the relevant bits to cut-out-and-keep. Any pointers will be very gratefully received. Cheers all. Tim Morley