emacs-devel
[Top][All Lists]
Advanced

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

Re: "Font-lock is limited to text matching" is a myth


From: Miles Bader
Subject: Re: "Font-lock is limited to text matching" is a myth
Date: Wed, 12 Aug 2009 00:36:00 +0900

Daniel Colascione <address@hidden> writes:
> AIUI, text properties are considered *part* of the document being
> edited, which is why modifying text properties modifies the buffer
> modified flag, why they appear in the undo list, and so on, whereas
> overlays are for transient, regenerable information *about* the text  in
> the document. Fontification is definitely regenerable, transient
> information, and so should use overlays.

I agree that it would be nice to have "unrecorded" text-properties.  As
Lennart mentioned, maybe just another flag option to `put-text-property'
(etc), meaning "don't put this change in the undo list, or change
buffer-modification state", would be enough (I haven't looked at the
details).

However, overlays aren't just "unrecorded text-properties", they are
also different in other ways -- in particular, each overlay is a
separate lisp object, with an identity, which can carry around its own
property list, does not coalesce with other overlays, can be moved, etc.

My impression is that for many fontification uses, while the
"unrecorded" nature of overlays would be very useful, their "identity"
nature would not be useful or would even pose a problem.

Overlays seem better suited to other uses, where you might want to move
around an overlay, or delete it easily given just a handle, etc.
[I don't think most fontification uses are like that.]

-Miles

-- 
`The suburb is an obsolete and contradictory form of human settlement'




reply via email to

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