Hrvoje> Simon, you know things about font-lock.  Perhaps you'd like to
Hrvoje> comment on this?  We're having a discussion about whether it
Hrvoje> is better to use text properties or extents for font-locking.
Hrvoje> (Text properties are much slower in XEmacs than they are in
Hrvoje> GNU Emacs.)
Sure.  IMHO, for conceptual, reasons font-lock.el should use
overlays/extents.  Text properties are what the phrase says---they are
intrinsic to the text and so should get saved with the text.  In the
case of font-lock.el, we just want to change how some "text" looks to
make it easier to read---because the text has meaning that is not
intrinsic to the text.  (When the "text" is a C program, superficially
it appears that font-lock.el is right to use text properties, but I
think this is misleading because font-lock.el usually gets it right.)
If you like, I think the highlighting is a property of the major-mode
rather than the buffer text.  If you paste text from a C mode buffer
into a Text mode buffer it should not take its highlighting with it.
But I don't know why font-lock.el uses text properties.  Perhaps it is
just because they were (and still are) much easier to use than
overlays/extents for the purposes of font-lock.el.  I don't know why
XEmacs has non-duplicable text properties.  Sounds like an oxymoron.
Simon.
    
    
    
 
                    
                    
                        
                        Show replies by date