From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: Help with font-lock-add-keywords Date: Fri, 13 Mar 2015 07:39:31 +0100 Message-ID: <87mw3he6zg.fsf@wmi.amu.edu.pl> References: <87pp8deg7s.fsf@wmi.amu.edu.pl> <87pp8d1ru5.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1426228804 23682 80.91.229.3 (13 Mar 2015 06:40:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Mar 2015 06:40:04 +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 Mar 13 07:39:57 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YWJGG-0004qB-FN for geh-help-gnu-emacs@m.gmane.org; Fri, 13 Mar 2015 07:39:56 +0100 Original-Received: from localhost ([::1]:35356 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWJGF-0005w7-EX for geh-help-gnu-emacs@m.gmane.org; Fri, 13 Mar 2015 02:39:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWJG4-0005w0-4X for help-gnu-emacs@gnu.org; Fri, 13 Mar 2015 02:39:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YWJFz-0004GV-6N for help-gnu-emacs@gnu.org; Fri, 13 Mar 2015 02:39:44 -0400 Original-Received: from msg.wmi.amu.edu.pl ([2001:808:114:2::50]:51360) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWJFy-0004G7-VU for help-gnu-emacs@gnu.org; Fri, 13 Mar 2015 02:39:39 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id C181457E44 for ; Fri, 13 Mar 2015 07:39:36 +0100 (CET) Original-Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lx6XHKyb0gn2 for ; Fri, 13 Mar 2015 07:39:36 +0100 (CET) Original-Received: from localhost (117-116.echostar.pl [213.156.117.116]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id 78EEB57E2F for ; Fri, 13 Mar 2015 07:39:36 +0100 (CET) In-reply-to: <87pp8d1ru5.fsf@web.de> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:808:114:2::50 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:103140 Archived-At: On 2015-03-13, at 04:47, Michael Heerdegen wrote: > Marcin Borkowski writes: > >> (font-lock-add-keywords nil '(("foo" . italic))) > > According to the doc of `font-lock-keywords', the FACENAME is actually > an expression that gets evaluated. So you must probably quote `italic', > or define a variable that is bound to 'italic. There are lots of > variables in Emacs named xxx-face that are bound to face names. Wow. Just wow! I thought I tried it, but somehow I must have done something wrong. I did what you suggested now and it worked. Thanks! For the record: both quoting and defining a variable worked. Also, the strange problem I was writing about seems to be fixed now. I guess what happened was this: I did not quote the name of the face (since it wasn't really `italic', it was my custom one), and Emacs tried to evaluate the unquoted (and undefined) symbol in the midst of fontifying, so there as an error and the fontifying routine crashed. (Just my suspicion, but seems reasonable.) > Michael. Thanks again! PS. Expect a blog post about keyword-based font-lock soon. ;-) -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University