help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem understanding font-lock-defaults structure


From: Xah
Subject: Re: problem understanding font-lock-defaults structure
Date: Thu, 9 Oct 2008 17:20:32 -0700 (PDT)
User-agent: G2/1.0

> (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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]