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

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

Re: case-insensitive regexp in derived-mode


From: Jacob Gerlach
Subject: Re: case-insensitive regexp in derived-mode
Date: Sun, 27 Apr 2014 16:46:33 -0700 (PDT)
User-agent: G2/1.0

> 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.



reply via email to

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