From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jacob Gerlach Newsgroups: gmane.emacs.help Subject: Re: case-insensitive regexp in derived-mode Date: Sun, 27 Apr 2014 16:46:33 -0700 (PDT) Message-ID: <90b96f2c-35e5-477d-bae4-9b46bf5ccec8@googlegroups.com> References: <4d9cd74d-624c-479d-a166-b995079f563e@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1398642627 19623 80.91.229.3 (27 Apr 2014 23:50:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 27 Apr 2014 23:50:27 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Apr 28 01:50:20 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WeYpv-0000P1-AM for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Apr 2014 01:50:19 +0200 Original-Received: from localhost ([::1]:40919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WeYpu-0004Hm-NJ for geh-help-gnu-emacs@m.gmane.org; Sun, 27 Apr 2014 19:50:18 -0400 X-Received: by 10.58.127.66 with SMTP id ne2mr11002973veb.27.1398642393730; Sun, 27 Apr 2014 16:46:33 -0700 (PDT) X-Received: by 10.140.101.147 with SMTP id u19mr945qge.10.1398642393703; Sun, 27 Apr 2014 16:46:33 -0700 (PDT) Original-Path: usenet.stanford.edu!cm18no6911029qab.0!news-out.google.com!dz10ni22607qab.1!nntp.google.com!ih12no542025qab.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: <4d9cd74d-624c-479d-a166-b995079f563e@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=98.217.114.175; posting-account=Hx-_8AoAAACyMXgs4MCS3wNERNLct_lk Original-NNTP-Posting-Host: 98.217.114.175 User-Agent: G2/1.0 Injection-Date: Sun, 27 Apr 2014 23:46:33 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:205136 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:97401 Archived-At: > 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 ), 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.