From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.cc-mode.general,gmane.emacs.devel Subject: Re: Advising in cc-awk.el and namespace Date: Wed, 16 Jul 2003 11:28:40 -0400 Sender: cc-mode-help-admin@lists.sourceforge.net Message-ID: <200307161528.h6GFSeVB025808@rum.cs.yale.edu> References: <200307111735.h6BHZaZO023544@rum.cs.yale.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1058369714 5053 80.91.224.249 (16 Jul 2003 15:35:14 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 16 Jul 2003 15:35:14 +0000 (UTC) Cc: "Stefan Monnier" , acm@muc.de, bug-cc-mode@gnu.org, emacs-devel@gnu.org Original-X-From: cc-mode-help-admin@lists.sourceforge.net Wed Jul 16 17:35:12 2003 Return-path: Original-Received: from lists.sourceforge.net ([66.35.250.206] helo=sc8-sf-list2.sourceforge.net) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19coHc-00018T-00 for ; Wed, 16 Jul 2003 17:33:32 +0200 Original-Received: from sc8-sf-list1-b.sourceforge.net ([10.3.1.13] helo=sc8-sf-list1.sourceforge.net) by sc8-sf-list2.sourceforge.net with esmtp (Exim 3.31-VA-mm2 #1 (Debian)) id 19coIk-0001hG-00; Wed, 16 Jul 2003 08:34:42 -0700 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by sc8-sf-list1.sourceforge.net with esmtp (Cipher TLSv1:DES-CBC3-SHA:168) (Exim 3.31-VA-mm2 #1 (Debian)) id 19coHj-0002q9-00 for ; Wed, 16 Jul 2003 08:33:40 -0700 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.20) id 19coHf-0004UY-D8 for bug-cc-mode@gnu.org; Wed, 16 Jul 2003 11:33:35 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19coFA-0001MZ-2q for bug-cc-mode@gnu.org; Wed, 16 Jul 2003 11:31:00 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19coCv-0000m7-OC; Wed, 16 Jul 2003 11:28:41 -0400 Original-Received: from rum.cs.yale.edu (localhost [127.0.0.1]) by rum.cs.yale.edu (8.12.8/8.12.8) with ESMTP id h6GFSf4Z025810; Wed, 16 Jul 2003 11:28:41 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.12.8/8.12.8/Submit) id h6GFSeVB025808; Wed, 16 Jul 2003 11:28:40 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Richard Stallman Errors-To: cc-mode-help-admin@lists.sourceforge.net X-BeenThere: cc-mode-help@lists.sourceforge.net X-Mailman-Version: 2.0.9-sf.net Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports, feature requests, and general talk about CC Mode. List-Unsubscribe: , List-Archive: X-Original-Date: Wed, 16 Jul 2003 11:28:40 -0400 Xref: main.gmane.org gmane.emacs.cc-mode.general:661 gmane.emacs.devel:15634 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:15634 > A change at pos N potentially changes the output of syntax-ppss for > all pos>N, so jit-lock just refontifies everything (in the background > with jit-lock-stealth-*). Of course, in practice the output of > syntax-ppss is generally not changed for all pos>N but only for N (or sometimes it is changed for all pos>N but the change is marginal or > irrelevant and will not influence the result of font-locking), so we could > be more clever, but we would need to cache the parse-state-before-change > so we can compare it to the parse-state-after-change so we can stop when > they are equal again. > > It would not be hard to cache the syntactic state every N lines in a > text property, and that way it would be possible to notice when > things get back in sync and end refontification. > > However, another solution is to stop refontifying at the next > start-of-defun after the last change. That should be really simple. > Could someone give that a try? That's a very good idea. The only problem for is that we don't really have that info right now. The only thing that jit-lock knows is whether to do the "contextual refontification" or not. Font-lock and syntax.el know a little bit more, in that they know how to find the previous start-of-defun, but not the next one (although depending on the value of font-lock-beginning-of-syntax-function and/or syntax-begin-function, the next-start-of-defun can be inferred). Stefan ------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here: http://www.vmware.com/wl/offer/345/0