From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Advising in cc-awk.el and namespace Date: Thu, 10 Jul 2003 19:31:48 +0000 (GMT) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <200307091720.h69HKLEN015169@rum.cs.yale.edu> Reply-To: Alan Mackenzie NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: main.gmane.org 1057866208 26944 80.91.224.249 (10 Jul 2003 19:43:28 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 10 Jul 2003 19:43:28 +0000 (UTC) Cc: bug-cc-mode@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Jul 10 21:43:26 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19ahKA-00070J-00 for ; Thu, 10 Jul 2003 21:43:26 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19ahVc-0001jh-00 for ; Thu, 10 Jul 2003 21:55:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19ahKc-0008Ux-Tm for emacs-devel@quimby.gnus.org; Thu, 10 Jul 2003 15:43:54 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19ahJo-00081a-Ve for emacs-devel@gnu.org; Thu, 10 Jul 2003 15:43:04 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19ahI1-0007Ue-Nt for emacs-devel@gnu.org; Thu, 10 Jul 2003 15:41:18 -0400 Original-Received: from acm.muc.de ([193.149.49.134] helo=acm.acm) by monty-python.gnu.org with esmtp (Exim 4.20) id 19ahDW-0005PA-FR; Thu, 10 Jul 2003 15:36:34 -0400 Original-Received: from localhost (root@localhost) by acm.acm (8.8.8/8.8.8) with SMTP id TAA00252; Thu, 10 Jul 2003 19:31:48 GMT X-Sender: root@acm.acm Original-To: Stefan Monnier In-Reply-To: <200307091720.h69HKLEN015169@rum.cs.yale.edu> X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:15534 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:15534 [emacs-devel added to the To:] On Wed, 9 Jul 2003, Stefan Monnier wrote: >Regarding c-awk-advise-fl-for-awk-region: A quick summary for others: c-awk-advise-fl-for-awk-region is a macro in cc-awk.el which advises four font-lock functions (e.g. font-lock-after-change-function) which get called as after-change-functions. The advice changes the BEGIN and END arguments to encompass the complete region which needs refontifying. This is done by syntactically analysing the AWK mode buffer. >It would really be helpful if package maintainers could tell us when >they need an `advice'. It's generally a sign of a shortcoming in the >basic functionality and so we need to know about it. I posted "Subject: Font-lock: Major mode should be able to specify region to fontify." in gnu.emacs.bug on 10 May 2002 21:31:03 +0200. This post contained tentative patches for font-lock.el, jit-lock.el and lazy-lock.el. It didn't spark off much discussion. Personally, I dislike the way font-locking is done at the moment. jit-lock-mode, though it speeds up the response of Emacs when first loading a file, is very wasteful of processor cycles. On my 166MHz machine (OK - but _somebody_'s got to keep pace with Dan J. :-), if I load a large file (say, ..../emacs/src/keyboard.c) wait for jit-lock to finish fontifying it in the background, then make a small change near the beginning of this file, needlessly refontifying ~320kBytes consumes ~55% of the CPU's power for 3=BD minutes. I have jit-lock-defer-contextually set to t, which is what causes the above. However, if the major mode were to specify the region to font-lock, jit-lock deferred "contextual" fontification would never be needed. Also, jit-lock sometimes MIS-fontifies code (for example, in Texinfo mode, if Auto Fill mode breaks up an @code{...} thing, for example, the new line gets the proper face to begin with, but loses it 3 seconds later. This happens because jit-lock yanks that line from its syntactic context before refontifying it. I'm talking about the jit-lock that was shipped with Emacs 21.1. Sorry if these things have since been fixed. [ .... ] >=09Stefan --=20 Alan Mackenzie (Munich, Germany)