From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Last steps for pretesting (font-lock-extend-region-function) Date: Tue, 25 Apr 2006 08:12:50 -0400 Message-ID: <87r73ldfxu.fsf-monnier+emacs@gnu.org> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1145967195 16254 80.91.229.2 (25 Apr 2006 12:13:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 25 Apr 2006 12:13:15 +0000 (UTC) Cc: Richard Stallman , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 25 14:13:12 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 1FYMPn-0004wu-6q for ged-emacs-devel@m.gmane.org; Tue, 25 Apr 2006 14:13:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FYMPm-0004Dh-Gm for ged-emacs-devel@m.gmane.org; Tue, 25 Apr 2006 08:13:10 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FYMPc-0004DP-In for emacs-devel@gnu.org; Tue, 25 Apr 2006 08:13:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FYMPb-0004Ct-4H for emacs-devel@gnu.org; Tue, 25 Apr 2006 08:13:00 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FYMPa-0004Co-R9 for emacs-devel@gnu.org; Tue, 25 Apr 2006 08:12:58 -0400 Original-Received: from [209.226.175.74] (helo=tomts20-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FYMRw-0002xc-IS; Tue, 25 Apr 2006 08:15:24 -0400 Original-Received: from alfajor ([70.55.144.118]) by tomts20-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20060425121250.IFSB16051.tomts20-srv.bellnexxia.net@alfajor>; Tue, 25 Apr 2006 08:12:50 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id 143EFD7855; Tue, 25 Apr 2006 08:12:50 -0400 (EDT) Original-To: Alan Mackenzie In-Reply-To: (Alan Mackenzie's message of "Tue, 25 Apr 2006 07:45:06 +0000 (GMT)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:53376 Archived-At: >> I don't claim it's buggy or even more buggy than font-lock-multiline. >> It's just an ugly kludge, ..... > I can't understand at all why you feel that. I really can't. To me, > f-l-e-r-f seems natural, simple and obvious. Optionally setting a hook > variable to a function is done countless times in Emacs. I can't see why > font-lock-extend-region-function is any more ugly than, say, > adaptive-fill-function. I'm not saying the hook is a kludge: I'm saying the code that uses it is a kludge, compared to the code that uses font-lock-multiline. >> ....much more heavyweight codewise (this is objectively the case in >> terms of lines of code, and I hope my comparison above convinces a few >> more people that it's also subjectively the case). > This is not the case. We're agreed that, for the f-l-multiline mechanism > to work, it needs supplementing by a f-l-extend-region-function hook. Yes, it needs such a hook called from font-lock-default-fontify-region. Just like your current hook that's called from font-lock-after-change-function. This is orthogonal. > If we need this hook anyway, why complicate it with f-l-multiline when the > hook works just fine on its own? There are two alternatives when writing your code in cc-mode: - use a hook in f-l-d-f-r + font-lock-multiline. The font-lock-multiline part of the code is a couple lines added to font-lock-keywords. - use a hook in f-l-d-f-r + a hook in f-l-a-c-f + a hook in b-c-f. The *-change-function part of the code is a good bit more than a couple lines. In which way does font-lock-multiline complicate "it"? Stefan