[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Advising in cc-awk.el and namespace

From: Alan Mackenzie
Subject: Re: Advising in cc-awk.el and namespace
Date: Thu, 10 Jul 2003 19:31:48 +0000 (GMT)

[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½ 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

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.

[ .... ]

>       Stefan

Alan Mackenzie (Munich, Germany)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]