all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: About intervals
Date: Tue, 19 Mar 2013 20:24:08 -0400	[thread overview]
Message-ID: <jwvobef3ozv.fsf-monnier+gmane.emacs.help@gnu.org> (raw)
In-Reply-To: m2fvzr5si9.fsf@gmail.com

> 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




  parent reply	other threads:[~2013-03-20  0:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.22454.1363691901.855.help-gnu-emacs@gnu.org>
2013-03-19 15:17 ` About intervals Helmut Eller
2013-03-19 22:41   ` Xue Fuqiao
2013-03-20  0:24   ` Stefan Monnier [this message]
2013-03-20 10:25     ` Xue Fuqiao
2013-03-19 11:18 Xue Fuqiao
2013-03-19 17:04 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvobef3ozv.fsf-monnier+gmane.emacs.help@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.