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: Wed, 26 Apr 2006 00:33:40 -0400 Message-ID: <87u08harmc.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 1146026041 16073 80.91.229.2 (26 Apr 2006 04:34:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 26 Apr 2006 04:34:01 +0000 (UTC) Cc: Richard Stallman , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 26 06:33:58 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 1FYbiw-0001CB-AT for ged-emacs-devel@m.gmane.org; Wed, 26 Apr 2006 06:33:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FYbiv-0002PU-Qj for ged-emacs-devel@m.gmane.org; Wed, 26 Apr 2006 00:33:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FYbij-0002Ot-8c for emacs-devel@gnu.org; Wed, 26 Apr 2006 00:33:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FYbih-0002OM-Ff for emacs-devel@gnu.org; Wed, 26 Apr 2006 00:33:44 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FYbih-0002OJ-Ct for emacs-devel@gnu.org; Wed, 26 Apr 2006 00:33:43 -0400 Original-Received: from [209.226.175.4] (helo=tomts16-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FYblI-0004er-94; Wed, 26 Apr 2006 00:36:24 -0400 Original-Received: from alfajor ([70.55.144.118]) by tomts16-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20060426043341.ZGVS27612.tomts16-srv.bellnexxia.net@alfajor>; Wed, 26 Apr 2006 00:33:41 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id C40BBD7855; Wed, 26 Apr 2006 00:33:40 -0400 (EDT) Original-To: Alan Mackenzie In-Reply-To: (Alan Mackenzie's message of "Tue, 25 Apr 2006 21:15:23 +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:53441 Archived-At: >> 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. > OK. I feel that existing code in AWK Mode is natural. (OK, I wrote it, > so I'm not in a position to judge it dispassionately, but ...). It notes > the logical EOL before a change. It notes the logical EOL after a > change. The later one is the end position for fontification. Why doesn't the BOL before change matter? Why does the EOL before change matter? > By contrast, the f-l-multiline method (ab)uses the structure for setting > face properties to set region boundaries for possible future changes. Abuses the structure of what? There two issues about multiline elements: - properly notice them when they appear - properly *re*fontify them when they change The first is taken care of by font-lock-fontify-region-function. The second talks about *re*fontification, so it's natural that it would involves saving some info during fontification for the next time around. Doing it in a-c-f is fundamentally not the right place since it doesn't know whether and how the changed text was fontified: it works, of course, but it's not particularly more natural. Stefan