From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Overlay tree. Stuck again Date: Fri, 13 Jan 2017 10:12:58 +0200 Message-ID: <83eg07cr91.fsf@gnu.org> References: <874m14rnl7.fsf@fastmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1484295207 22609 195.159.176.226 (13 Jan 2017 08:13:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 13 Jan 2017 08:13:27 +0000 (UTC) Cc: emacs-devel@gnu.org To: Joakim Jalap Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 13 09:13:20 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 1cRwyo-0003dE-WE for ged-emacs-devel@m.gmane.org; Fri, 13 Jan 2017 09:12:59 +0100 Original-Received: from localhost ([::1]:39727 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRwyt-0004Bm-8T for ged-emacs-devel@m.gmane.org; Fri, 13 Jan 2017 03:13:03 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRwym-0004Be-CZ for emacs-devel@gnu.org; Fri, 13 Jan 2017 03:12:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRwyh-0008Db-Dy for emacs-devel@gnu.org; Fri, 13 Jan 2017 03:12:56 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51224) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRwyh-0008DV-Ag; Fri, 13 Jan 2017 03:12:51 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3014 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cRwyg-0006B5-Jf; Fri, 13 Jan 2017 03:12:51 -0500 In-reply-to: <874m14rnl7.fsf@fastmail.com> (message from Joakim Jalap on Thu, 12 Jan 2017 22:10:44 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:211238 Archived-At: > From: Joakim Jalap > Date: Thu, 12 Jan 2017 22:10:44 +0100 > > However the nodes can be updated "externally" from the trees point of > view. For example if there is a delete in the buffer those overlays > which were in the deleted portion of the buffer will now be crowded at > the from_char of the delete. But those could have any address, so they > will probably be out of order. The problem is how to get them in order > again. > > As far as I've gotten is to gather all the affected nodes (which I think > are only those of length zero which start (and end) at from_char) into > an array and sort that. But I can't figure out how to get them into the > tree again while keeping all the pointers correct. This might be a silly idea, but did you try removing them from the tree, and then re-adding them? (I assume that adding a node will produce an ordered tree.) Apologies if I'm missing something obvious.