From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Joerg Schuster Newsgroups: gmane.emacs.help Subject: Re: write your own emacs mode Date: 16 Dec 2003 11:05:06 +0100 Organization: Department of Computer Sciences, University of Munich Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: 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 1071569890 22105 80.91.224.253 (16 Dec 2003 10:18:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 16 Dec 2003 10:18:10 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 16 11:18:03 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 1AWCHC-00046V-01 for ; Tue, 16 Dec 2003 11:18:02 +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 1AWDBS-0004rQ-5m for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Dec 2003 06:16:10 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!informatik.tu-muenchen.de!lmu.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 42 Original-NNTP-Posting-Host: pinatubo.cis.uni-muenchen.de Original-X-Trace: minotaurus.cip.informatik.uni-muenchen.de 1071569106 26677 129.187.148.50 (16 Dec 2003 10:05:06 GMT) Original-X-Complaints-To: usenet@informatik.uni-muenchen.de Original-NNTP-Posting-Date: Tue, 16 Dec 2003 10:05:06 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-Xref: shelby.stanford.edu gnu.emacs.help:119369 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:15310 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:15310 Jesper Harder writes: > You can either turn of syntactic fontification in your mode (this will > also inhibit font locking of comments) or modify the syntax table of > the mode. I tried to do this. But I don't quite understand the relation of modify-syntax-entry and define-generic-mode. Does the meaning of the regexes (like in ;;1) depend on the syntax-table? Why do the regexes ;;a and ;;b match parts of the same "word" (where word is any string that doesn't contain \s characters)? According to C-h f define-generic-modeI, ;;2 is a FUNCTION-LIST argument. Why isn't it possible to write '((modify-syntax-entry ?/ "w")) at this place? Jörg ;; grammar-mode (define-generic-mode 'grammar-mode '("%") '( "adj" "adj4" "adj5" ) '( ;;1 ("\\([\\*\\+\\?]\\)" 1 'font-lock-function-name-face) ("\\([:]\\)" 1 'font-lock-warning-face) ("\\(/[^\\s]+\\)" 1 'font-lock-string-face) ;;a ("\\([A-Z][A-Za-z0-9]*\\)" 1 'font-lock-type-face) ;;b ) '("\\.syn\\'") nil ;;2 "Major mode for editing grammar files as used by pm and skonk.")