help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: write your own emacs mode


From: Joerg Schuster
Subject: Re: write your own emacs mode
Date: 16 Dec 2003 11:05:06 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Jesper Harder <harder@myrealbox.com> 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.")

   


reply via email to

[Prev in Thread] Current Thread [Next in Thread]