From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Last steps for pretesting (font-lock-extend-region-function) Date: Wed, 26 Apr 2006 07:44:11 +0000 (GMT) Message-ID: References: <87zmi9arwz.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: sea.gmane.org 1146048060 20215 80.91.229.2 (26 Apr 2006 10:41:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 26 Apr 2006 10:41:00 +0000 (UTC) Cc: Ralf Angeli , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 26 12:40:56 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FYhS4-0005yg-0w for ged-emacs-devel@m.gmane.org; Wed, 26 Apr 2006 12:40:56 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FYhS3-0000CD-Re for ged-emacs-devel@m.gmane.org; Wed, 26 Apr 2006 06:40:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FYhRi-0008TQ-3R for emacs-devel@gnu.org; Wed, 26 Apr 2006 06:40:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FYhRh-0008T8-Hy for emacs-devel@gnu.org; Wed, 26 Apr 2006 06:40:33 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FYhRh-0008T3-ES for emacs-devel@gnu.org; Wed, 26 Apr 2006 06:40:33 -0400 Original-Received: from [193.149.49.134] (helo=acm.acm) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FYhUL-0002dr-Kf for emacs-devel@gnu.org; Wed, 26 Apr 2006 06:43:18 -0400 Original-Received: from localhost (root@localhost) by acm.acm (8.8.8/8.8.8) with SMTP id HAA00575; Wed, 26 Apr 2006 07:44:11 GMT X-Sender: root@acm.acm Original-To: Stefan Monnier In-Reply-To: <87zmi9arwz.fsf-monnier+emacs@gnu.org> X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:53460 Archived-At: Hi, Stefan~ On Wed, 26 Apr 2006, Stefan Monnier wrote: >> Would this not be very inconvenient? Somebody needing the extend-region >> functionality in f-l-d-f-r would then have to copy the entire source of >> the default function, amend the source, make the >> f-l-fontify-region-funtion buffer local, then set it. >Of course not, just use a function like > (defun c-awk-font-lock-fontify-region (beg end &rest args) > (apply 'font-lock-default-fontify-region > (c-awk-beginning-of-logical-line beg) > (c-awk-end-of-logical-line end) > args)) Heh! Thanks, I should have spotted that myself! That wouldn't work in the general case, though, because the current implementation of f-l-d-f-r would foul up the BEG and END parameters unless they happen to be at line boundaries. This is another reason for the refactoring I've been suggesting, to extract a core function from f-l-d-f-r which fontifies exactly the region it's given. >-- Stefan -- Alan.