From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Joakim Jalap Newsgroups: gmane.emacs.devel Subject: Re: Overlays as an AA-tree Date: Mon, 06 Feb 2017 16:40:29 +0100 Message-ID: <874m07nx8y.fsf@fastmail.com> References: <87d1jylv43.fsf@fastmail.com> <87fujv64mn.fsf@hochschule-trier.de> <87fujvpkzc.fsf@fastmail.com> <87vasr5tqd.fsf@hochschule-trier.de> <87d1ex4kon.fsf@hochschule-trier.de> <87d1evod6x.fsf@fastmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1486396272 29399 195.159.176.226 (6 Feb 2017 15:51:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 6 Feb 2017 15:51:12 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (berkeley-unix) Cc: Andreas Politz , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 06 16:51:09 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1calZG-0007BY-FX for ged-emacs-devel@m.gmane.org; Mon, 06 Feb 2017 16:51:02 +0100 Original-Received: from localhost ([::1]:49137 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1calZM-0004zF-1H for ged-emacs-devel@m.gmane.org; Mon, 06 Feb 2017 10:51:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1calP8-0004qq-NT for emacs-devel@gnu.org; Mon, 06 Feb 2017 10:40:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1calP5-0003uX-IX for emacs-devel@gnu.org; Mon, 06 Feb 2017 10:40:34 -0500 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:50273) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1calP5-0003uM-Ep for emacs-devel@gnu.org; Mon, 06 Feb 2017 10:40:31 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id DECF520A6F; Mon, 6 Feb 2017 10:40:30 -0500 (EST) Original-Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Mon, 06 Feb 2017 10:40:30 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=dj2GRpGJnEwreDZwO98po8pqIfA=; b=xnu8MF ohOzEROG4VsiUXl5qFKR7l/lojMgGbIu3tyiNAkvEurjWiulrm6+gxKu4lX9OHWs i+K3eIDor5HEkS1nS1OlnSoeBBHA0MJxMvOulgd/nMgQjsiVNLvY5saI6H5lhoBy 7LKsaj69UEx4subxpSAnNZ70YxjPJfYvESyIk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=smtpout; bh=dj2GRpGJnEwreD ZwO98po8pqIfA=; b=PdF/+pJHChIm6OUByH+zEX2zAsM68gj9VbiySU5sc3tXy1 9R0dUd42AExqubnUw3iMv+9lbL0YDMsotjjnGDaYabLGaS1kV0XtfZO7kVPTAafi jQOhbkGK96SNcy8xnAGQpbJov9huVVg7hAZi2ML2oPyt3TkDUxeaGEpIUuHN8= X-ME-Sender: X-Sasl-enc: 8d/lRfcOk4cNzCsQjz6+EAfBJrIFJBOmgNcb1uT5UfsU 1486395630 Original-Received: from genserv (unknown [5.150.202.248]) by mail.messagingengine.com (Postfix) with ESMTPA id 233927E5D5; Mon, 6 Feb 2017 10:40:30 -0500 (EST) In-Reply-To: (Stefan Monnier's message of "Mon, 06 Feb 2017 08:51:20 -0500") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.25 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:212034 Archived-At: Stefan Monnier writes: >> And here I thought it was rather an elegant solution :) (to the problem >> of one overlay's beg going past another's because of an insert). > > It doesn't solve the problem of updating the tree after > a deletion (where some overlays may suddenly end up at the same place, > so the tree will also need some amount of reorganization). But an overlay can't *pass* another because of a delete, so I think that case is OK. >> What's a better way? When adjusting for an insert at an overlay with >> front-advance non nil, first delete it from the tree, then >> reinsert it? > > The way I look at it, there's no good reason to try and be very clever: > whenever the text is modified somewhere, remove all the overlays whose > end points fall within (or on the edge of) the change, and then > re-insert them. This sounds very expensive to me, theres quite a lot of rebalncing going on at insertion/deletion. But maybe that isn't a problem. -- Joakim