all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Luca Ferrari <fluca1978@infinito.it>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: new major mode doubts
Date: Fri, 18 Jan 2013 07:03:43 +0400	[thread overview]
Message-ID: <87mww7ry40.fsf@yandex.ru> (raw)
In-Reply-To: <CAKoxK+7=BkKtDejRJiCTTj8DaFa8Ft=FQ=0yLxACFLNDwT_tOw@mail.gmail.com> (Luca Ferrari's message of "Thu, 17 Jan 2013 09:07:34 +0100")

Luca Ferrari <fluca1978@infinito.it> 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 http://emacswiki.org/emacs/ModeTutorial 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.



  parent reply	other threads:[~2013-01-18  3:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-17  8:07 new major mode doubts Luca Ferrari
2013-01-17  8:14 ` Luca Ferrari
2013-01-17 14:53 ` Doug Lewan
2013-01-17 15:52 ` Aurélien Aptel
2013-01-18  3:03 ` Dmitry Gutov [this message]
2013-01-19  9:40   ` Luca Ferrari

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=87mww7ry40.fsf@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=fluca1978@infinito.it \
    --cc=help-gnu-emacs@gnu.org \
    /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.