From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Newsgroups: gmane.emacs.help Subject: Re: problem understanding font-lock-defaults structure Date: Thu, 9 Oct 2008 17:20:32 -0700 (PDT) Organization: http://groups.google.com Message-ID: <07d7062c-bd40-4941-9ae3-e91e59a56691@s9g2000prg.googlegroups.com> References: <13173afe-f51c-4c67-b738-1949f2b28b5f@f40g2000pri.googlegroups.com> <296d3d40-598c-4ea4-8394-c69975c0399f@a3g2000prm.googlegroups.com> <5f116baa-33e0-48ed-a27e-8446a7791c1d@a18g2000pra.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1223599246 19758 80.91.229.12 (10 Oct 2008 00:40:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Oct 2008 00:40:46 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 10 02:41:44 2008 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.50) id 1Ko64e-0003Kw-8H for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Oct 2008 02:41:44 +0200 Original-Received: from localhost ([127.0.0.1]:54367 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ko63a-0000Pn-53 for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Oct 2008 20:40:38 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!s9g2000prg.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 55 Original-NNTP-Posting-Host: 24.6.185.159 Original-X-Trace: posting.google.com 1223598032 2754 127.0.0.1 (10 Oct 2008 00:20:32 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 10 Oct 2008 00:20:32 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s9g2000prg.googlegroups.com; posting-host=24.6.185.159; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.22, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:163302 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:58645 Archived-At: > (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 =E2=88=91 http://xahlee.org/ =E2=98=84 On Thu, Oct 9, 2008 at 4:27 PM, Nikolaj Schumacher wrote: Xah wrote: > (setq font-lock-keywords > ( > myKeywordsLevel1 > nil > nil > ) > ) > > (font-lock-fontify-buffer) > > In the =E2=80=9Csetq font-lock-keywords=E2=80=9D, 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)