From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Face specifications in font-lock-keywords (part II). Date: Thu, 07 Apr 2005 11:32:41 -0400 Message-ID: References: <87hdiiyiwa.fsf@xs4all.nl> <871x9magj0.fsf-monnier+emacs@gnu.org> <878y3uww2k.fsf@xs4all.nl> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1112888525 14425 80.91.229.2 (7 Apr 2005 15:42:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 7 Apr 2005 15:42:05 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 07 17:42:02 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DJZ7p-0000YV-0A for ged-emacs-devel@m.gmane.org; Thu, 07 Apr 2005 17:40:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DJYh9-0005SI-8t for ged-emacs-devel@m.gmane.org; Thu, 07 Apr 2005 11:13:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DJYf2-0004Fc-Og for emacs-devel@gnu.org; Thu, 07 Apr 2005 11:11:14 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DJYf2-0004AD-6V for emacs-devel@gnu.org; Thu, 07 Apr 2005 11:11:12 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DJZ0b-00072f-8Q for emacs-devel@gnu.org; Thu, 07 Apr 2005 11:33:29 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id C7AE834000B; Thu, 7 Apr 2005 11:32:47 -0400 (EDT) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id ECA4F4AC2B3; Thu, 7 Apr 2005 11:32:41 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id D385BE6C21; Thu, 7 Apr 2005 11:32:41 -0400 (EDT) Original-To: Lute Kamstra In-Reply-To: <878y3uww2k.fsf@xs4all.nl> (Lute Kamstra's message of "Thu, 07 Apr 2005 15:33:23 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-4.831, requis 5, autolearn=not spam, AWL 0.07, BAYES_00 -4.90) X-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:35700 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:35700 > Does that mean that Font Lock erroneously strips the quote in the > first case? Looks like it. And looks like it's done on purpose, although I don't know what this purpose is: (defun font-lock-compile-keyword (keyword) (cond ((nlistp keyword) ; MATCHER (list keyword '(0 font-lock-keyword-face))) ((eq (car keyword) 'eval) ; (eval . FORM) (font-lock-compile-keyword (eval (cdr keyword)))) ((eq (car-safe (cdr keyword)) 'quote) ; (MATCHER . 'FORM) ;; If FORM is a FACENAME then quote it. Otherwise ignore the quote. (if (symbolp (nth 2 keyword)) (list (car keyword) (list 0 (cdr keyword))) (font-lock-compile-keyword (cons (car keyword) (nth 2 keyword))))) ((numberp (cdr keyword)) ; (MATCHER . MATCH) (list (car keyword) (list (cdr keyword) 'font-lock-keyword-face))) ((symbolp (cdr keyword)) ; (MATCHER . FACENAME) (list (car keyword) (list 0 (cdr keyword)))) ((nlistp (nth 1 keyword)) ; (MATCHER . HIGHLIGHT) (list (car keyword) (cdr keyword))) (t ; (MATCHER HIGHLIGHT ...) keyword))) -- Stefan