From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Newsgroups: gmane.emacs.help Subject: problem understanding font-lock-defaults structure Date: Wed, 8 Oct 2008 11:46:33 -0700 (PDT) Organization: http://groups.google.com Message-ID: 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 1223494857 11598 80.91.229.12 (8 Oct 2008 19:40:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Oct 2008 19:40:57 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 08 21:41:53 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 1Kneuq-0007ll-KD for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Oct 2008 21:41:48 +0200 Original-Received: from localhost ([127.0.0.1]:44318 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Knetm-0007NM-Ua for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Oct 2008 15:40:42 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!a3g2000prm.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 48 Original-NNTP-Posting-Host: 24.6.185.159 Original-X-Trace: posting.google.com 1223491593 6858 127.0.0.1 (8 Oct 2008 18:46:33 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 8 Oct 2008 18:46:33 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a3g2000prm.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:163216 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:58564 Archived-At: 2008-01-13 i'm having some problem understanding font-lock-defaults. For example, i have the following text in a buffer: ------------------------ Sin[x]^2 + Cos[y]^2 =3D 1 (setq font-lock-defaults '( ( ( ("Sin\\|Cos" . font-lock-function-name-face) ("x\\|y" . font-lock-variable-name-face) ("=CF=80" . font-lock-constant-face) ) ; level 1 fontlock nil ; no level 2 of fontlock nil ; no level 3 of fontlock ) ;; t ; keywords only ;; nil ; case matters ;; nil ; no highlighting by syntax ;; nil ; no hint on syntax begin for highlighting ) ) (font-lock-fontify-buffer) --------------------------------- After i evaluate the lisp code, i expect, the Sin should be syntax highlighted but is not. One thing i find elisp manual on this confusing is exactly what is the structure of the keyword argument, i.e. the first element of the value for font-lock-defaults. I'm not sure how many level of list is required, or if the nesting is optional... The other thing i'm not sure is perhaps my quoting is not correct? After several variations, i can't get it to work. Any ideas? Thanks. Xah =E2=88=91 http://xahlee.org/ =E2=98=84