From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Overlays as an AA-tree Date: Mon, 06 Feb 2017 08:51:20 -0500 Message-ID: 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 1486389127 18216 195.159.176.226 (6 Feb 2017 13:52:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 6 Feb 2017 13:52:07 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: Andreas Politz , emacs-devel@gnu.org To: Joakim Jalap Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 06 14:52:03 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 1caji4-0004TI-VH for ged-emacs-devel@m.gmane.org; Mon, 06 Feb 2017 14:52:01 +0100 Original-Received: from localhost ([::1]:47606 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cajiA-000202-9u for ged-emacs-devel@m.gmane.org; Mon, 06 Feb 2017 08:52:06 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cajhb-0001zx-B0 for emacs-devel@gnu.org; Mon, 06 Feb 2017 08:51:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cajhY-0001AB-6q for emacs-devel@gnu.org; Mon, 06 Feb 2017 08:51:31 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:41818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cajhY-00019E-1J for emacs-devel@gnu.org; Mon, 06 Feb 2017 08:51:28 -0500 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id v16DpKgM005493; Mon, 6 Feb 2017 08:51:20 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 3732C662A1; Mon, 6 Feb 2017 08:51:20 -0500 (EST) In-Reply-To: <87d1evod6x.fsf@fastmail.com> (Joakim Jalap's message of "Mon, 06 Feb 2017 10:56:06 +0100") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV5941=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5941> : inlines <5673> : streams <1731751> : uri <2372512> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 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:212027 Archived-At: > 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). > 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. Stefan