all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* case-insensitive regexp for fontlock specification
@ 2008-08-12 10:42 Joe Bloggs
  2008-08-13  1:51 ` Kevin Rodgers
  0 siblings, 1 reply; 2+ messages in thread
From: Joe Bloggs @ 2008-08-12 10:42 UTC (permalink / raw)
  To: help-gnu-emacs

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?


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-08-13  1:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-12 10:42 case-insensitive regexp for fontlock specification Joe Bloggs
2008-08-13  1:51 ` Kevin Rodgers

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.