[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: font-lock-keywords: matcher function not working
From: |
Stefan Monnier |
Subject: |
Re: font-lock-keywords: matcher function not working |
Date: |
Fri, 28 Jun 2013 22:35:32 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
> Thank you again, Stefan. However, I still don't understand.
Your function should search for the first occurrence of the thing you're
looking for, between here and ^end and only if there isn't any should it
return nil.
Instead, your current function only checks whether "here" is a spot that
matches the thing you're looking for. Instead, when you find out that
"here" is not a match, don't return nil: try to look further instead.
This is typically done with a loop.
In your case, I wouldn't use a function anyway: I'd just use a regexp
like "^[^ \t]*(".
Stefan