unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: rusi <rustompmody@gmail.com>
To: help-gnu-emacs@gnu.org
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)	[thread overview]
Message-ID: <36bc8d1f-5b95-4661-8bac-3dbfe44c38c7@f20g2000prn.googlegroups.com> (raw)
In-Reply-To: slrnijodcu.15e.grahn+nntp@frailea.sa.invalid

On Jan 23, 7:05 pm, Jorgen Grahn <grahn+n...@snipabacken.se> wrote:
> On Sun, 2011-01-23, rusi wrote:
> > On Jan 23, 3:41 am, jdiam...@snipthis.AcadiaU.ca wrote:
> >> I have the following file...
>
> > snipped
>
> >>     (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.  I 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örgen Grahn <jgr...@algonet.se>
> ;; All right reserved.
> ;;
> ;; $Id: refer-mode.el,v 1.3 2005/10/30 17:08:15 grahn Exp $
> ;; $Name:  $
>
> (defconst refer-font-lock-keywords
>   '(("^%Z.*$" . font-lock-comment-face)
>     ("^%[ATQ] .+$" . font-lock-keyword-face)
>     ("^%[K] .+$" . font-lock-string-face)
>     )
>   "Syntax highlighting for Refer mode.")
>
> (define-derived-mode refer-mode text-mode "Refer"
>   "Major mode for editing refer(1) bibliographies.
> This is merely text mode, plus some colorization.
>
> A subjective quick guide to the keywords:
>
> %T title                 %D year of publication
> %A author                %I issuer/publisher
> %Q corporate author      %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.)"
>
>   (setq comment-start "%Z")
>   (setq comment-start-skip "%Z\\s-*")
>
>   (set (make-local-variable 'font-lock-defaults)
>        '((refer-font-lock-keywords
>           refer-font-lock-keywords
>           refer-font-lock-keywords
>           refer-font-lock-keywords)
>          t)))
>
> (provide 'refer-mode)
>
> --
>   // Jorgen Grahn <grahn@  Oo  o.   .  .
> \X/     snipabacken.se>   O  o   .

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.


  reply	other threads:[~2011-01-23 16:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-22 22:41 cc-mode in emacs 23.2 goes into infinte loop jdiamond
2011-01-23  9:54 ` rusi
2011-01-23 14:05   ` foo-font-lock-keywords (was Re: cc-mode in emacs 23.2 goes into infinte loop) Jorgen Grahn
2011-01-23 16:49     ` rusi [this message]
2011-01-23 19:22       ` Jim Diamond
2011-01-23 16:47   ` cc-mode in emacs 23.2 goes into infinte loop Jim Diamond
2011-01-23 17:57     ` rusi

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=36bc8d1f-5b95-4661-8bac-3dbfe44c38c7@f20g2000prn.googlegroups.com \
    --to=rustompmody@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).