all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jacob Gerlach <jacobgerlach@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: case-insensitive regexp in derived-mode
Date: Sun, 27 Apr 2014 16:46:33 -0700 (PDT)	[thread overview]
Message-ID: <90b96f2c-35e5-477d-bae4-9b46bf5ccec8@googlegroups.com> (raw)
In-Reply-To: <4d9cd74d-624c-479d-a166-b995079f563e@googlegroups.com>

> Now my keywords are working, but the regexp to colour keyword is case insensitive.

The tutorial shows:
(define-derived-mode math-lang-mode fundamental-mode
  (setq font-lock-defaults '(myKeywords))
  (setq mode-name "math lang")
)

If you look at the documentation for font-lock-defaults (C-h v font-lock-defaults <RET>), you will see an option for case-fold-search when specifying font-lock-defaults, so you instead want to use something like:

(setq font-lock-defaults '(myKeywords nil t))

The tutorials I read led me to use setq-local, but perhaps this is unnecessary, since as Emmanuel pointed out, it automatically becomes buffer local when set.



      parent reply	other threads:[~2014-04-27 23:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-27 23:14 case-insensitive regexp in derived-mode jfjfcli
2014-04-27 23:38 ` Emanuel Berg
2014-04-28  3:04   ` jfjfcli
2014-04-27 23:46 ` Jacob Gerlach [this message]

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=90b96f2c-35e5-477d-bae4-9b46bf5ccec8@googlegroups.com \
    --to=jacobgerlach@gmail.com \
    --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.