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

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

case-insensitive regexp for fontlock specification


From: Joe Bloggs
Subject: case-insensitive regexp for fontlock specification
Date: Tue, 12 Aug 2008 11:42:29 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Hi, I am writing a major mode for editing SPSS files.
I am following the tutorial on this webpage:
http://renormalist.net/cgi-bin/twiki/view/Renormalist/EmacsLanguageModeCreationTutorial

The keyword matching for font-lock should be case-insensitive. 
Is there an easy way to specify this?
At the moment I have the following (abbreviated):

(defconst spss-font-lock-keywords-1
  (list
   '("\\<\\(if\\|followed\\|by\\|some\\|other\\|keywords\\)\\>" . 
font-lock-keyword-face)
   "Minimal highlighting expressions for spss mode.")

which only matches lower case. I could change it like this for example:

(defconst spss-font-lock-keywords-1
  (list
   '("\\<\\([iI][fF]\\|followed\\|by\\|some\\|other\\|keywords\\)\\>" . 
font-lock-keyword-face)
   "Minimal highlighting expressions for spss mode.")

to make it match if, If, iF & IF, but to make that change for every keyword 
would take ages.

Is there a simpler way?


reply via email to

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