help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need help for using a function as matcher in `font-lock-add-keywords


From: Thorsten Jolitz
Subject: Re: Need help for using a function as matcher in `font-lock-add-keywords'
Date: Tue, 16 Apr 2013 17:57:57 +0200
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux)

Thorsten Jolitz <tjolitz@gmail.com> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]