Emacs, elisp, major modes, and Regex's

Michael Bond <[email protected]> Fri, 28 Oct 2005 09:17:16 -0400
Newsgroups gmane.org.user-groups.linux.morlug
Message-ID <[email protected]>
I need some more eyes looking at this, I haven't been able to find  
the problem in this yet.

I am combining a couple major-modes for procmail that I have found  
around the web and adding some of my own font-lock rules for syntax  
highlighting. (tinytools, even just the procmail part, is more than I  
want. All of the other procmail modes I found are lacking considerably)

The following rule (listed at the bottom) is supposed to match   
keywords ("From", "To", "Subject", etc ... ) and color them blue. It  
works fine for all cases I use except when matching this (and any  
other like it):

(To|CC|Delivered-To|BCC|Envelope-to)

It matches every other keyword. So "To", "Delivered-To","Envelope-to"  
are colored blue. The rest
are ignored. It doesn't matter what order, or how many there are,  
every other keyword starting with the first is matched and the others  
are ignored.

Here is the regex that I am trying to use to match these:

(list
  (concat
   "[^_a-zA-Z0-9]\\("
   "From\\|To\\|Subject\\|"
   "Reply-To\\|CC\\|Delivered-To\\|BCC\\|"
   "Envelope-to"
  "\\)[^_a-zA-Z0-9]")
  1 'font-lock-function-name-face)


Mike.
[email protected]