From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Friedrich Dominicus Newsgroups: gmane.emacs.help Subject: Re: How easy to create new major mode? Date: 31 Jan 2003 18:02:58 +0100 Organization: Q Software Solutions GmbH Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87el6tgsl9.fsf@fbigm.here> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1044032761 13890 80.91.224.249 (31 Jan 2003 17:06:01 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 31 Jan 2003 17:06:01 +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 18eec1-0003bc-00 for ; Fri, 31 Jan 2003 18:05:57 +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 18eeba-0005f7-03 for gnu-help-gnu-emacs@m.gmane.org; Fri, 31 Jan 2003 12:05:30 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.icl.net!newsfeed.fjserv.net!feed.news.nacamar.de!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 30 Original-X-Trace: news.t-online.com 1044032286 03 12017 BZ-cEx7TSIHK3i 030131 16:58:06 Original-X-Complaints-To: abuse@t-online.com X-Sender: 320004655587-0001@t-dialin.net User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Native Windows TTY Support) Original-Xref: shelby.stanford.edu gnu.emacs.help:109654 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:6170 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:6170 "Tim Morley \(remove vegetable for email address\)" writes: > 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. Well if you are interested in Emacs Lisp programming, have a look at "Writing GNU Emacs extensions", there is a chapter in it on how to develop you own major mode. > > 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). No for such simple thing an own major mode is over-kill. Check the documentation for font-face, This will be enough for what you are planning to do. Regards Friedrich