From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: rfflrccrd@gmail.com Newsgroups: gmane.emacs.help Subject: Re: font-lock-keywords: matcher function not working Date: Fri, 28 Jun 2013 03:43:05 -0700 (PDT) Message-ID: <8d3f8211-d708-4e79-aab4-6cc8141c6c92@googlegroups.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1372428196 32044 80.91.229.3 (28 Jun 2013 14:03:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Jun 2013 14:03:16 +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 16:03:18 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 1UsZGf-0002MS-Uw for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Jun 2013 16:03:18 +0200 Original-Received: from localhost ([::1]:53861 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsZGf-0006KC-Hi for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Jun 2013 10:03:17 -0400 X-Received: by 10.224.172.136 with SMTP id l8mr3126983qaz.2.1372416185621; Fri, 28 Jun 2013 03:43:05 -0700 (PDT) X-Received: by 10.49.133.201 with SMTP id pe9mr333018qeb.34.1372416185605; Fri, 28 Jun 2013 03:43:05 -0700 (PDT) Original-Path: usenet.stanford.edu!news.glorb.com!news-out.readnews.com!transit4.readnews.com!209.85.216.87.MISMATCH!j2no1605155qak.0!news-out.google.com!f7ni58qai.0!nntp.google.com!j2no2824774qak.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=79.109.41.235; posting-account=iscNFgoAAAANEah9YzNOOYVI-4RgnElR Original-NNTP-Posting-Host: 79.109.41.235 User-Agent: G2/1.0 Injection-Date: Fri, 28 Jun 2013 10:43:05 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:199547 X-Mailman-Approved-At: Fri, 28 Jun 2013 10:02:58 -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:91815 Archived-At: On Thursday, June 27, 2013 7:32:57 PM UTC+2, Stefan Monnier wrote: > Your rr-match-indented-paren should *search* rather than only check the > > current position. Thank you for your attention, Stefan. However, doesn't my matcher function search already? It checks the current position first to return NIL for a failed match. OTOH, when the check succeeds, the matcher function calls `re-search-forward' to set `match-data' appropriately. IMO, this is the expected behaviour according to the documentation of `font-lock-keywords': "MATCHER [...] should return non-nil, move point, and set `match-data' appropriately if it succeeds; like `re-search-forward' would." Otherwise - that is: when the match fails - MATCHER should do nothing and return NIL, shouldn't it? > While I'm here, I recommend you (setq font-lock-support-mode nil) then > > disable&enable font-lock so that jit-lock won't be used: this makes it > > much easier to debug the code, especially when it signals errors (or > > course, you also want to set debug-on-error to t). Thank you for these tips.