[Top][All Lists]

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

Re: overlays vs text properties

From: Eli Zaretskii
Subject: Re: overlays vs text properties
Date: Wed, 13 Jul 2011 02:59:34 -0400

> From: Eric Abrahamsen <address@hidden>
> Date: Tue, 12 Jul 2011 23:12:20 -0700
> I can't decide whether to use overlays or regular properties. The
> advantages of using overlays seem to be:
> 1. I can make a single named overlay, and move it around the buffer with
>    move-overlay. Nice and clean, no searching for boundaries of things
>    and suchlike.
> 2. I can attach multiple properties to a single overlay -- saves time
>    and effort, and seems like good programming.
> The disadvantage seems to be the practical issue that overlays don't
> come with point-entered/point-left special properties -- ie, there's no
> good way of keeping track of when point is going in and out of a
> paragraph with the overlay, and then moving the overlay to the
> next/previous/other paragraph.
> Does anyone have any experience they'd like to share on this point?
> Should I just use fundamental text properties?

You didn't give enough information to help you with this issue.  For
example: how many properties/overlays will exist in a given buffer
simultaneously?  Text properties scale much better than overlays, so
this information is important.

Also, text properties by default are copied with text, while overlays
are not.  Will this be an issue in your application?

Overlays can overlap, while text properties cannot (for the same
property).  Is this a possible issue for you?

Etc. etc.  IOW, tell more about your application to get any advice
beyond a list of abstract cons and pros.

reply via email to

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