From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: rusi Newsgroups: gmane.emacs.help Subject: Re: foo-font-lock-keywords (was Re: cc-mode in emacs 23.2 goes into infinte loop) Date: Sun, 23 Jan 2011 08:49:28 -0800 (PST) Organization: http://groups.google.com Message-ID: <36bc8d1f-5b95-4661-8bac-3dbfe44c38c7@f20g2000prn.googlegroups.com> References: <1cb4543e-859f-40b2-b72f-460e2de06b35@w2g2000yqb.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1295804545 19302 80.91.229.12 (23 Jan 2011 17:42:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 23 Jan 2011 17:42:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 23 18:42:21 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ph3xE-0001A0-JJ for geh-help-gnu-emacs@m.gmane.org; Sun, 23 Jan 2011 18:42:20 +0100 Original-Received: from localhost ([127.0.0.1]:40916 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ph3xE-0004Vt-5L for geh-help-gnu-emacs@m.gmane.org; Sun, 23 Jan 2011 12:42:20 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!f20g2000prn.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 76 Original-NNTP-Posting-Host: 116.73.35.230 Original-X-Trace: posting.google.com 1295801368 30495 127.0.0.1 (23 Jan 2011 16:49:28 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 23 Jan 2011 16:49:28 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f20g2000prn.googlegroups.com; posting-host=116.73.35.230; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:184518 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:78679 Archived-At: On Jan 23, 7:05=A0pm, Jorgen Grahn wrote: > On Sun, 2011-01-23, rusi wrote: > > On Jan 23, 3:41=A0am, jdiam...@snipthis.AcadiaU.ca wrote: > >> I have the following file... > > > snipped > > >> =A0 =A0 (setq zsd-c-font-lock-keywords-3 nil) > > > No I dont have an answer (and please excuse my hijacking your question > > for mine :-) ) > > You should at least have changed the subject line. > > > but do you know where I can find out about things like > > foo-font-lock-keywords-{1,2,3}? > > > Both C and lisp modes are too deep-structured for me to easily figure > > out... > > > IOW just looking for a typical, simple language mode that uses font- > > lock correctly... > > Here is a really simple one. Works for me -- if major things are > missing or wrong, I haven't noticed. =A0I had to google around and > experiment a lot to get it to this state. > > ;;; refer-mode.el -- Major mode for refer(1) files > ;; > ;; Copyright (C) 2005 J=F6rgen Grahn > ;; All right reserved. > ;; > ;; $Id: refer-mode.el,v 1.3 2005/10/30 17:08:15 grahn Exp $ > ;; $Name: =A0$ > > (defconst refer-font-lock-keywords > =A0 '(("^%Z.*$" . font-lock-comment-face) > =A0 =A0 ("^%[ATQ] .+$" . font-lock-keyword-face) > =A0 =A0 ("^%[K] .+$" . font-lock-string-face) > =A0 =A0 ) > =A0 "Syntax highlighting for Refer mode.") > > (define-derived-mode refer-mode text-mode "Refer" > =A0 "Major mode for editing refer(1) bibliographies. > This is merely text mode, plus some colorization. > > A subjective quick guide to the keywords: > > %T title =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 %D year of publication > %A author =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0%I issuer/publisher > %Q corporate author =A0 =A0 =A0%C city of publication > [...] > Compare with the standard, but obsolete, bib-mode, which handles the > approximately same file format. (Oddly enough, Bib-mode handles > refer(1) files; refbib and refer.el handle BibTeX.)" > > =A0 (setq comment-start "%Z") > =A0 (setq comment-start-skip "%Z\\s-*") > > =A0 (set (make-local-variable 'font-lock-defaults) > =A0 =A0 =A0 =A0'((refer-font-lock-keywords > =A0 =A0 =A0 =A0 =A0 refer-font-lock-keywords > =A0 =A0 =A0 =A0 =A0 refer-font-lock-keywords > =A0 =A0 =A0 =A0 =A0 refer-font-lock-keywords) > =A0 =A0 =A0 =A0 =A0t))) > > (provide 'refer-mode) > > -- > =A0 // Jorgen Grahn \X/ =A0 =A0 snipabacken.se> =A0 O =A0o =A0 . Well Thanks for the efforts Jorgen But I am specifically interested in whats with the font-lock-keywords-{1,2,3} what are the differences, what should go in each etc.