From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ralf Angeli Newsgroups: gmane.emacs.devel Subject: Re: Last steps for pretesting (font-lock-extend-region-function) Date: Tue, 25 Apr 2006 21:02:39 +0200 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1145991778 15390 80.91.229.2 (25 Apr 2006 19:02:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 25 Apr 2006 19:02:58 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 25 21:02:55 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 1FYSnV-0001AB-Qr for ged-emacs-devel@m.gmane.org; Tue, 25 Apr 2006 21:02:06 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FYSnV-0007ql-DQ for ged-emacs-devel@m.gmane.org; Tue, 25 Apr 2006 15:02:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FYSnJ-0007qf-O6 for emacs-devel@gnu.org; Tue, 25 Apr 2006 15:01:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FYSnI-0007pw-CB for emacs-devel@gnu.org; Tue, 25 Apr 2006 15:01:53 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FYSnI-0007pk-5k for emacs-devel@gnu.org; Tue, 25 Apr 2006 15:01:52 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FYSpo-00034i-1M for emacs-devel@gnu.org; Tue, 25 Apr 2006 15:04:28 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FYSmw-00014s-B7 for emacs-devel@gnu.org; Tue, 25 Apr 2006 21:01:30 +0200 Original-Received: from dialin-212-144-186-087.pools.arcor-ip.net ([212.144.186.87]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 25 Apr 2006 21:01:30 +0200 Original-Received: from angeli by dialin-212-144-186-087.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 25 Apr 2006 21:01:30 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 30 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: dialin-212-144-186-087.pools.arcor-ip.net Cancel-Lock: sha1:zIicXHUtKkcBhtMMpRlaoWr6cQQ= 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:53404 Archived-At: * Alan Mackenzie (2006-04-24) writes: > after-change-functions is the canonical way of solving problems related > to buffer changes. This includes Font Locking. But extending the region in the after-change case does not help with "normal" fontification by region as e.g. done by jit-lock. > I say to you again - your solution is not robust. I don't think it's > been tried at all (correct me if I'm wrong). Hopefully I understand "your solution" correctly here if I am assuming this relates to putting the hook into `font-lock-default-fontify-region'. I've implemented a variant of this approach for AUCTeX by using a custom-made function for `font-lock-fontify-region-function' which calls other functions for extending the region and then calls `font-lock-default-fontify-region' with the extended region as arguments. There is no special code in `after-change-functions' and the approach actually works quite well. > We are both aware of a refinement > which is needed, namely calling some sort of f-l-extend-region-f from > f-l-d-f-r and j-l-f-n. If putting the hook into `font-lock-default-fontify-region' works reliably, why do you need it in `after-change-functions' and `jit-lock-fontify-now' as well? -- Ralf