unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Xah <xahlee@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: problem understanding font-lock-defaults structure
Date: Thu, 9 Oct 2008 17:20:32 -0700 (PDT)	[thread overview]
Message-ID: <07d7062c-bd40-4941-9ae3-e91e59a56691@s9g2000prg.googlegroups.com> (raw)
In-Reply-To: mailman.739.1223594868.25473.help-gnu-emacs@gnu.org

> (setq font-lock-keywords myKeywordsLevel1)

Thanks!

gosh, something is wrong with the manual. I think the elisp manual is
superb, but for the first time i find the chapter on major-mode and
the font-lock-mode quite sub par in clarity, completeness, and most of
all lacking good content.

http://xahlee.org/elisp/Major-Modes.html
http://xahlee.org/elisp/Font-Lock-Mode.html

the chapter on major-mode doesn't really say exactly how one creates
it. After reading it, one doesn't get any idea what exactly is the
mechanism that creates a major mode. (is it purely a function name
ending in mode??) The bulk of it is a list of conventions. These
conventions are described fuzzily, as if assuming the reader are
already expert of the elisp system. One's not clear which of the item
in the convention section is required for thing to work, which is
required for the mode to work as expected of emacs major modes, and
which are just suggestions on niceties.

the most important part of writing a mode, the syntax highlighting...
the font lock mode section is rather confusing about font-lock-
keywords and font-lock-defaults...

  Xah
∑ http://xahlee.org/

☄

On Thu, Oct 9, 2008 at 4:27 PM, Nikolaj Schumacher <me@nschum.de>
wrote:
Xah <xahlee@gmail.com> wrote:

> (setq font-lock-keywords
>  (
>  myKeywordsLevel1
>  nil
>  nil
>  )
> )
>
> (font-lock-fontify-buffer)
>
> In the “setq font-lock-keywords”, block, i tried various quoting and
> nesting but no go.

The idea of multiple levels of fontification is in a higher
abstraction
level than this.  `font-lock-keywords' doesn't support it.

(setq font-lock-keywords myKeywordsLevel1)



  parent reply	other threads:[~2008-10-10  0:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-08 18:46 problem understanding font-lock-defaults structure Xah
2008-10-08 21:22 ` Nikolaj Schumacher
     [not found] ` <mailman.619.1223500981.25473.help-gnu-emacs@gnu.org>
2008-10-09  0:02   ` Xah
2008-10-09  0:54     ` Lennart Borgman (gmail)
2008-10-09  2:25       ` Kevin Rodgers
     [not found]       ` <mailman.643.1223519147.25473.help-gnu-emacs@gnu.org>
2008-10-09 21:18         ` Xah
2008-10-09 11:13     ` Nikolaj Schumacher
     [not found]     ` <mailman.637.1223513718.25473.help-gnu-emacs@gnu.org>
2008-10-09 15:04       ` Xah
2008-10-09 15:26         ` harven
2008-10-09 17:17           ` Nikolaj Schumacher
     [not found]     ` <mailman.677.1223550826.25473.help-gnu-emacs@gnu.org>
2008-10-09 15:29       ` Xah
2008-10-09 17:16         ` Nikolaj Schumacher
     [not found]         ` <mailman.719.1223572620.25473.help-gnu-emacs@gnu.org>
2008-10-09 21:40           ` Xah
2008-10-09 23:27             ` Nikolaj Schumacher
     [not found]             ` <mailman.739.1223594868.25473.help-gnu-emacs@gnu.org>
2008-10-10  0:20               ` Xah [this message]
2008-10-10  0:45             ` Tim X

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=07d7062c-bd40-4941-9ae3-e91e59a56691@s9g2000prg.googlegroups.com \
    --to=xahlee@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).