[Top][All Lists]

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

Re: new major mode doubts

From: Dmitry Gutov
Subject: Re: new major mode doubts
Date: Fri, 18 Jan 2013 07:03:43 +0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt)

Luca Ferrari <address@hidden> writes:

> Hi all,
> as an exercise I'm trying to implement my own major mode for a
> programming language (dataflex, for what it matters). I'm following
> the Mode Tutorial and so far
> I've the skeleton of the mode to work for me.
> However, I've got a couple of doubts:
> 1) in the keyword list I specified a regexp for uppercase keywords as follows:
>  (defconst dataflex-font-lock-keywords-minimal
>   (list
> '("\\<\\(BEGIN\\|E\\(?:LSE\\|ND\\)\\|FOR\\|IF\\|LOOP\\|MOVE\\|||T\\(?:HEN\\|O\\)\\|WHILE\\)\\>"
> . font-lock-builtin-face )
>    '("\\('\\w*'\\)" . font-lock-variable-name-face) )
>   "Main (and minimal) highlighting for the Dataflex mode keywords" )
> however my keywords could be camel case (therefore BEGIN, begin, bEgin
> are all the same). Do I have to specify upper and lower case words
> individually (avoiding the mess of the camel case) or is there a
> smarter way to do it (e.g., checking the font lock against lowercased
> words)?

See the `font-lock-defaults' doc. The third element is CASE-FOLD, and
this value is assigned to `font-lock-keywords-case-fold-search', which
also see.

reply via email to

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