From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: overlays vs text properties Date: Wed, 13 Jul 2011 02:59:34 -0400 Message-ID: References: <87k4bmk8u3.fsf@ericabrahamsen.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1310540766 17540 80.91.229.12 (13 Jul 2011 07:06:06 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 13 Jul 2011 07:06:06 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Eric Abrahamsen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 13 09:06:02 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QgtW8-00067H-IJ for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Jul 2011 09:05:56 +0200 Original-Received: from localhost ([::1]:38871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QgtW7-0003Mb-Ar for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Jul 2011 03:05:55 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:55391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QgtQ4-0002Z9-IJ for help-gnu-emacs@gnu.org; Wed, 13 Jul 2011 02:59:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QgtPz-0002Rc-Jl for help-gnu-emacs@gnu.org; Wed, 13 Jul 2011 02:59:40 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:60573) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QgtPz-0002RY-8r for help-gnu-emacs@gnu.org; Wed, 13 Jul 2011 02:59:35 -0400 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1QgtPy-00045Q-62; Wed, 13 Jul 2011 02:59:34 -0400 In-reply-to: <87k4bmk8u3.fsf@ericabrahamsen.net> (message from Eric Abrahamsen on Tue, 12 Jul 2011 23:12:20 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.10 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:81564 Archived-At: > From: Eric Abrahamsen > 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.