From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.help Subject: Re: new major mode doubts Date: Fri, 18 Jan 2013 07:03:43 +0400 Message-ID: <87mww7ry40.fsf@yandex.ru> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1358478255 449 80.91.229.3 (18 Jan 2013 03:04:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Jan 2013 03:04:15 +0000 (UTC) Cc: help-gnu-emacs To: Luca Ferrari Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 18 04:04:33 2013 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 1Tw2Fj-0001ob-JO for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Jan 2013 04:04:23 +0100 Original-Received: from localhost ([::1]:49465 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tw2FS-00038d-SG for geh-help-gnu-emacs@m.gmane.org; Thu, 17 Jan 2013 22:04:06 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:59490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tw2FI-00038U-N2 for help-gnu-emacs@gnu.org; Thu, 17 Jan 2013 22:04:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tw2FC-0001bK-Iu for help-gnu-emacs@gnu.org; Thu, 17 Jan 2013 22:03:56 -0500 Original-Received: from mail-la0-f49.google.com ([209.85.215.49]:64423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tw2FC-0001a0-9l for help-gnu-emacs@gnu.org; Thu, 17 Jan 2013 22:03:50 -0500 Original-Received: by mail-la0-f49.google.com with SMTP id fk20so3405663lab.36 for ; Thu, 17 Jan 2013 19:03:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=KLKwILppnAcx+mmcuHQ2cncEZeZq4WoPSvX0h7oEfsQ=; b=Bo0CDUeOMCcEVrdMUyAlnFZhFl9VOgRm9MyAgMX8RLUHcgvSBoz5rBLKfg4gUfR2Dp pHOaqxKEuYF/1z2OtUYhQjsI5XOFj8Na3zC/1XoDW29QmPe8H3gWjy+ju9XOwBMJ4JdJ L5hE7znNWYnRNcLSm988DcqoTzOhWa5FSca9aj67DDU1hgmRQn3CkFoD67OWlBErhb3K LzlaczqcnTtrQOEMBMXvduBelUrIN9qsx7aVeUNDsCRVW1F/+/Bl3p8kRKdX6M+vjtdP C986VX9uR1WDQ6JnHdJG2bWq0YinOoANscr3FSy+nxl9O5E9fAD/sH2s7K44rnqrT/km VcjQ== X-Received: by 10.112.46.37 with SMTP id s5mr3116887lbm.67.1358478228951; Thu, 17 Jan 2013 19:03:48 -0800 (PST) Original-Received: from SOL ([178.252.98.87]) by mx.google.com with ESMTPS id to7sm1422972lab.13.2013.01.17.19.03.46 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 17 Jan 2013 19:03:47 -0800 (PST) In-Reply-To: (Luca Ferrari's message of "Thu, 17 Jan 2013 09:07:34 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.215.49 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:88698 Archived-At: Luca Ferrari 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.