From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xue Fuqiao Newsgroups: gmane.emacs.help Subject: Re: About intervals Date: Wed, 20 Mar 2013 18:25:51 +0800 Organization: The Church of Emacs Message-ID: <20130320182551.eff6164d2faa134974b51c68@gmail.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1363775171 3930 80.91.229.3 (20 Mar 2013 10:26:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Mar 2013 10:26:11 +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 11:26:38 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 1UIGE9-0006di-Nr for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Mar 2013 11:26:37 +0100 Original-Received: from localhost ([::1]:37776 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIGDm-0003f8-HO for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Mar 2013 06:26:14 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIGDZ-0003ev-3s for help-gnu-emacs@gnu.org; Wed, 20 Mar 2013 06:26:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIGDX-0005cI-6Z for help-gnu-emacs@gnu.org; Wed, 20 Mar 2013 06:26:01 -0400 Original-Received: from mail-pb0-f50.google.com ([209.85.160.50]:58314) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIGDW-0005cC-Vq for help-gnu-emacs@gnu.org; Wed, 20 Mar 2013 06:25:59 -0400 Original-Received: by mail-pb0-f50.google.com with SMTP id up1so1234276pbc.9 for ; Wed, 20 Mar 2013 03:25:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:subject:message-id:in-reply-to:references :organization:x-mailer:mime-version:content-type :content-transfer-encoding; bh=XmePiOC4G+c70J5pptfPUkAz/rfS7QW3w58jL2WevZE=; b=XBta6sReOpi8RvuhefgNs+EmZj1kr1GngqWkTvo8ICNXcpfe0C5IyROb/aozlRzYou ihDb9Z5YiwgO23ropVw1v4DZuJN1HCZKPL51Dcje1hAiLs3a2zAul93vEdSuXq1qUhpA JHNnRvpc9M55qwjYrbUfePgBOtEbSZS/o9AS99tStso1XY3v6jkWOwUsqLPO7C8/gPh1 QXtmrkfnNeoaaISXFTDo+RTBhdSUisI+BDpOuupZLTQsEbcfy5nwavKY/k4DBCN66nCe HF/WMIY/wy2CAIibGtinHg64RP5NrQukCCTJqbFk/9gkgppvi3kLuJhrvxWFe4vGcNj7 fJqA== X-Received: by 10.68.213.193 with SMTP id nu1mr7987852pbc.178.1363775157954; Wed, 20 Mar 2013 03:25:57 -0700 (PDT) Original-Received: from Emacs (li497-201.members.linode.com. [106.187.102.201]) by mx.google.com with ESMTPS id dl1sm1636220pbc.17.2013.03.20.03.25.54 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Mar 2013 03:25:56 -0700 (PDT) In-Reply-To: X-Mailer: Sylpheed 3.2.0 (GTK+ 2.24.13; x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.160.50 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:89606 Archived-At: On Tue, 19 Mar 2013 20:24:08 -0400 Stefan Monnier wrote: > > 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: I think so, too. > 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: The manual's references to intervals are both concepts. See: (info "(elisp) Garbage Collection") (info "(elisp) Memory Usage") (info "(elisp) Buffer Internals") But AFAIK there are not any disambiguation about these two meanings in Emacs manuals. > 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. I think overlays often cause some problems (although they are minor). E.g., http://lists.gnu.org/archive/html/emacs-devel/2005-11/msg01346.html So I don't use it much, anyway. -- Happy birthday, GNU Emacs! 1985-2013