From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Raffaele Ricciardi Newsgroups: gmane.emacs.help Subject: Re: font-lock-keywords: matcher function not working Date: Fri, 28 Jun 2013 22:50:17 +0200 Message-ID: References: <8d3f8211-d708-4e79-aab4-6cc8141c6c92@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1372453522 20407 80.91.229.3 (28 Jun 2013 21:05:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Jun 2013 21:05:22 +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 Jun 28 23:05:24 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 1Usfr8-0001YY-An for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Jun 2013 23:05:22 +0200 Original-Received: from localhost ([::1]:55038 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Usfr7-0003zF-Tg for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Jun 2013 17:05:21 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 16 Original-X-Trace: individual.net Meoz/+k/S4UE8GxNGxSb/QRK+muop/BtydeUqqLLGbiB6kY2ob Cancel-Lock: sha1:s+kUc9lm+uux0caD0A5AK8NvynM= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 In-Reply-To: Original-Xref: usenet.stanford.edu gnu.emacs.help:199565 X-Mailman-Approved-At: Fri, 28 Jun 2013 17:04:46 -0400 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:91831 Archived-At: On 28/06/13 21:30, Stefan Monnier wrote: > That's not a search. It just says "doesn't match here" without saying > anything about the rest of the text until ^end, whereas a nil return > value is supposed to mean "nothing found between here and ^end" (just > as a nil return value of `re-search-forward'). Thank you again, Stefan. However, I still don't understand. The check is there because Emacs' regular expressions lack a "look behind" construct, and the matcher has to check for leading whitespace. How is it supposed to look? I chose to look for leading whitespace separately, and to choose afterwards whether to return NIL immediately or to return the result of `re-search-forward' - which at that point is guaranteed to succeed - but such call is a shortcut to ensure that the matcher returns information consistent to the requirements of the font locking engine. Am I missing something?