From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: About intervals Date: Tue, 19 Mar 2013 20:24:08 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1363739083 28829 80.91.229.3 (20 Mar 2013 00:24:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Mar 2013 00:24:43 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 20 01:25:05 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UI6q1-0007uP-7n for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Mar 2013 01:25:05 +0100 Original-Received: from localhost ([::1]:34806 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI6pd-0002C0-Sk for geh-help-gnu-emacs@m.gmane.org; Tue, 19 Mar 2013 20:24:41 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI6pO-0002Be-KS for help-gnu-emacs@gnu.org; Tue, 19 Mar 2013 20:24:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UI6pJ-0002r8-KN for help-gnu-emacs@gnu.org; Tue, 19 Mar 2013 20:24:26 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:41681) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI6pJ-0002nf-Dq for help-gnu-emacs@gnu.org; Tue, 19 Mar 2013 20:24:21 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UI6pe-0007gu-W8 for help-gnu-emacs@gnu.org; Wed, 20 Mar 2013 01:24:43 +0100 Original-Received: from 69-196-171-192.dsl.teksavvy.com ([69.196.171.192]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 Mar 2013 01:24:42 +0100 Original-Received: from monnier by 69-196-171-192.dsl.teksavvy.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 Mar 2013 01:24:42 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 27 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 69-196-171-192.dsl.teksavvy.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:L3FYFfbTyami11JJssUeDf5XSM8= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:89603 Archived-At: > I think RMS had some dispute with Lucid people whether the interval tree > is good idea; it was one reason why XEmacs was forked and I think it's > the reason why this is mentioned in the manual at all. I think the reason is related but different: while text-properties are implemented with a balanced tree whose name in the C code is "interval", the manual's reference to intervals is for things like overlays and extents, whereas from that point of view text-properties do not behave like intervals: When you use put-text-property, you just add that property to each char in the specified range. Whereas when you use an overlay or an extent you put the property on the interval that contains those chars. That looks very similar, but if you later insert a char somewhere in the middle, this char will necessarily be part of the interval, whereas it will not have the text-property that was set to the surrounding chars (unless you specifically ask to inherit those properties, e.g. via insert-and-inherit). Other differences are that you can query the set of intervals (extents, or overlays) that cover a particular position in the buffer, but that same question is meaningless for text-properties. At best you can find the neighboring chars whose property has the same value. Stefan