From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.help Subject: Re: Need help for using a function as matcher in `font-lock-add-keywords' Date: Tue, 16 Apr 2013 17:57:57 +0200 Message-ID: <8761zmqxh6.fsf@gmail.com> References: <87ehear25m.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1366127905 23900 80.91.229.3 (16 Apr 2013 15:58:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Apr 2013 15:58:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 16 17:58:30 2013 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 1US8H5-0004Hc-In for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Apr 2013 17:58:27 +0200 Original-Received: from localhost ([::1]:41949 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US8H5-0004Ik-A4 for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Apr 2013 11:58:27 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US8Gp-00048R-Kg for help-gnu-emacs@gnu.org; Tue, 16 Apr 2013 11:58:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1US8Gk-0003kD-TC for help-gnu-emacs@gnu.org; Tue, 16 Apr 2013 11:58:11 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:51696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US8Gk-0003k5-Mc for help-gnu-emacs@gnu.org; Tue, 16 Apr 2013 11:58:06 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1US8Gj-0003na-B1 for help-gnu-emacs@gnu.org; Tue, 16 Apr 2013 17:58:05 +0200 Original-Received: from e178059133.adsl.alicedsl.de ([85.178.59.133]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 Apr 2013 17:58:05 +0200 Original-Received: from tjolitz by e178059133.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 Apr 2013 17:58:05 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 46 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: e178059133.adsl.alicedsl.de User-Agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:sgMT1uZZwuy3KxN4hds+KpTunq0= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:90195 Archived-At: Thorsten Jolitz writes: > - do a simple regexp search for outline-regexp first > - then calculate the outline-level of a matched headline > - then determine the right font for that headline-level > > It seemed to me that using a function as matcher in > `font-lock-add-keywords' would be the right thing in this case, but what > I have until now does not work - the function is actually never entered > and thus fontification doesn't happen. after some modification of the code I posted I now get this as result of 'font-lock-add-key-words': ,------------------------------------------------------------ | Result: (outshine-match-next-headline 0 outshine-level-1 t) `------------------------------------------------------------ but fontification does not work, 'outshine-match-next-headline' is never entered, and I get the following error: ,------------------------------------------------------------------------------- | Error during redisplay: (jit-lock-function 1) signaled (invalid-function 1) | Error during redisplay: (jit-lock-function 531) signaled (invalid-function 1) | Error during redisplay: (jit-lock-function 1050) signaled (invalid-function 1) | Error during redisplay: (jit-lock-function 1555) signaled (invalid-function 1) | Error during redisplay: (jit-lock-function 2066) signaled (invalid-function 1) `------------------------------------------------------------------------------- Is there a syntax-error in this line? ,---------------------------------------------------- | (outshine-match-next-headline 0 outshine-level-1 t) `---------------------------------------------------- Examples given in (info "(elisp)Search-based Fontification") look similar: ,------------------------------- | ("foo\\|bar" 0 foo-bar-face t) `------------------------------- -- cheers, Thorsten