all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Joerg Schuster <js@cis.uni-muenchen.de>
Subject: Re: write your own emacs mode
Date: 16 Dec 2003 11:05:06 +0100	[thread overview]
Message-ID: <crthe019iy5.fsf@pinatubo.cis.uni-muenchen.de> (raw)
In-Reply-To: m3fzfms1dd.fsf@defun.localdomain

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	other threads:[~2003-12-16 10:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-15 10:06 write your own emacs mode Joerg Schuster
2003-12-15 12:37 ` Jesper Harder
2003-12-16 10:05   ` Joerg Schuster [this message]
2003-12-16 12:37     ` Jesper Harder
2003-12-16 13:06       ` Joerg Schuster
2003-12-16 13:51   ` F. Schaefer
2003-12-16 14:21     ` Joerg Schuster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=crthe019iy5.fsf@pinatubo.cis.uni-muenchen.de \
    --to=js@cis.uni-muenchen.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.