[Top][All Lists]

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

Re: something like linum.el ought to be added

From: Joe Wells
Subject: Re: something like linum.el ought to be added
Date: Fri, 14 Sep 2007 17:15:19 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> Yes, that's how I'm doing it now; update is now also added to several
>> other hooks. One oversight in Emacs is, I think, that the functions in
>> window-size-change-functions are invoked as regular functions in
>> xdisp.c, therefore making the hook buffer-local currently results in
>> an error (due to 't'). I'm thus modifying the global hook for now.
> I think your code should rely on fontification-functions instead of fiddling
> with things like window-size-change-functions.  It may very well be that
> fontification-functions doesn't work quite right for you, tho (basically it
> was defined for jit-lock and I believe that putting more than one function
> on it won't work right, so maybe you'd want to use jit-lock-register
> instead).

Some comments on the idea of relying on fontification-functions:

I think linum.el should work even if the user has font-locking turned
off, so it shouldn't depend on jit-lock.el (unless jit-lock can be
used without turning font-locking on?).  Anyway, the whole
font-locking subsystem is also quite hard to understand, so it seems
unwise to me to get linum.el tied up in that complexity.  And
font-locking is oriented toward fontifying the entire buffer
eventually while with line numbering you probably only want to keep
active overlays for the displayed region.

And it seems it would be hard for fontification-functions will work
well with linum.el as a separate user from jit-lock.el, because they
would both be competing for control of the same fontified property.
So, for example, if stealth background fontification fontified some
region, it would (I think?) place a non-nil value on the fontified
property of that region, and then when that region was displayed by
scrolling there would be nothing to trigger the line numbering.

I hope these comments are helpful.


reply via email to

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