From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: emacs question Date: Fri, 21 May 2010 15:33:19 +0200 Message-ID: <87632hjs68.fsf@thinkpad.tsdh.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1274448958 21251 80.91.229.12 (21 May 2010 13:35:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 21 May 2010 13:35:58 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 21 15:35:57 2010 connect(): No such file or directory Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OFSOJ-0004YI-2Z for geh-help-gnu-emacs@m.gmane.org; Fri, 21 May 2010 15:35:55 +0200 Original-Received: from localhost ([127.0.0.1]:38291 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFSOI-0007sn-DX for geh-help-gnu-emacs@m.gmane.org; Fri, 21 May 2010 09:35:54 -0400 Original-Received: from [140.186.70.92] (port=50148 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFSM3-0006xP-VT for help-gnu-emacs@gnu.org; Fri, 21 May 2010 09:33:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OFSLw-0006Uk-LI for help-gnu-emacs@gnu.org; Fri, 21 May 2010 09:33:34 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:46391) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFSLw-0006UL-Dp for help-gnu-emacs@gnu.org; Fri, 21 May 2010 09:33:28 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OFSLv-0002zH-Lw for help-gnu-emacs@gnu.org; Fri, 21 May 2010 15:33:27 +0200 Original-Received: from tsdh.uni-koblenz.de ([141.26.67.142]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 21 May 2010 15:33:27 +0200 Original-Received: from tassilo by tsdh.uni-koblenz.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 21 May 2010 15:33:27 +0200 X-Injected-Via-Gmane: http://gmane.org/ connect(): No such file or directory Original-Lines: 76 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: tsdh.uni-koblenz.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:ydBIcxHCEy1r+3RwT4LWX+wPiMQ= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:73712 Archived-At: "Rina & Avner" writes: Hi! > I'm looking for a way to create a new emacs font-lock 'XXX-mode' and > to add to it a very big set of strings. (VLSI netlist names, sch > format) > > Can you help with some directives? Well, if you only want to do some highlighting, you probably want to start with `define-generic-mode'. ,----[ C-h f define-generic-mode RET ] | define-generic-mode is a Lisp macro in `generic.el'. | | (define-generic-mode MODE COMMENT-LIST KEYWORD-LIST FONT-LOCK-LIST | AUTO-MODE-LIST FUNCTION-LIST &optional DOCSTRING) | | Create a new generic mode MODE. | | MODE is the name of the command for the generic mode; don't quote it. | The optional DOCSTRING is the documentation for the mode command. If | you do not supply it, `define-generic-mode' uses a default | documentation string instead. | | COMMENT-LIST is a list in which each element is either a character, a | string of one or two characters, or a cons cell. A character or a | string is set up in the mode's syntax table as a "comment starter". | If the entry is a cons cell, the `car' is set up as a "comment | starter" and the `cdr' as a "comment ender". (Use nil for the | latter if you want comments to end at the end of the line.) Note that | the syntax table has limitations about what comment starters and | enders are actually possible. | | KEYWORD-LIST is a list of keywords to highlight with | `font-lock-keyword-face'. Each keyword should be a string. | | FONT-LOCK-LIST is a list of additional expressions to highlight. Each | element of this list should have the same form as an element of | `font-lock-keywords'. | | AUTO-MODE-LIST is a list of regular expressions to add to | `auto-mode-alist'. These regular expressions are added when Emacs | runs the macro expansion. | | FUNCTION-LIST is a list of functions to call to do some additional | setup. The mode command calls these functions just before it runs the | mode hook `MODE-hook'. | | See the file generic-x.el for some examples of `define-generic-mode'. `---- For additional infos, have a look at the elisp docs. ,----[ (info "(elisp)Major Modes") ] | Major modes specialize Emacs for editing particular kinds of text. | Each buffer has only one major mode at a time. `---- That for major modes, and that for font locking (highlighting): ,----[ (info "(elisp)Font Lock Mode") ] | "Font Lock mode" is a feature that automatically attaches `face' | properties to certain parts of the buffer based on their syntactic | role. How it parses the buffer depends on the major mode; most major | modes define syntactic criteria for which faces to use in which | contexts. This section explains how to customize Font Lock for a | particular major mode. `---- This should get you started. Come back when you have a specific question. Bye, Tassilo