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: Overlay tree. Stuck again Date: Thu, 12 Jan 2017 22:10:44 +0100 Message-ID: <874m14rnl7.fsf@fastmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1484255480 14524 195.159.176.226 (12 Jan 2017 21:11:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 12 Jan 2017 21:11:20 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (berkeley-unix) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 12 22:11:16 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 1cRmeN-0002n3-1s for ged-emacs-devel@m.gmane.org; Thu, 12 Jan 2017 22:11:11 +0100 Original-Received: from localhost ([::1]:36717 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRmeP-0001Ty-Qc for ged-emacs-devel@m.gmane.org; Thu, 12 Jan 2017 16:11:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRmeJ-0001Tt-Tr for emacs-devel@gnu.org; Thu, 12 Jan 2017 16:11:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRmeG-0005CZ-PA for emacs-devel@gnu.org; Thu, 12 Jan 2017 16:11:07 -0500 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:58147) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cRmeG-0005BW-KA for emacs-devel@gnu.org; Thu, 12 Jan 2017 16:11:04 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 58A1C20C76 for ; Thu, 12 Jan 2017 16:11:01 -0500 (EST) Original-Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Thu, 12 Jan 2017 16:11:01 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-type:date:from:message-id:mime-version:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=yAZ T8OT8zjkKy+a2aUOEkwSW5n0=; b=NPLszFGLVCU5SgiPCQL1r6OdQVFri4eK4dw SUS7iMZYTVADSQ/k2sMpw0dbLHDlrwByJZIT+7aG86kaWD5zBRXoIlsZvLKLBD4L NfSaKtbL8marv+hQ5hFoSenxeQUSzyTWT2ok5xEi3ZcCAkRwyJProBaOfM1o8F5O WNXpKsew= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=smtpout; bh=yAZT8OT8zjkKy+a2aUOEkwSW5n0=; b=S5WOE E9vX2GeOGGzKDIwV4g2H10GTixi4V7Q9wOQgbTcka6m0G5jLQlvmTWVLnumGozsE KJc3gHnbfqBogbxBIexv+OvcKD+oebLxuVIQq1Ri4eViVem6OT3UoYXrV2QEMO2P +4w8XaFZpP+ympuynKexbQ7XS61geI2aDXFBfg= X-ME-Sender: X-Sasl-enc: drDO9PhInB7Hv5+QIwY9Zv3+8l50Ch0ITpbLM+0KBc2e 1484255460 Original-Received: from genserv (unknown [5.150.202.248]) by mail.messagingengine.com (Postfix) with ESMTPA id B98A47E188 for ; Thu, 12 Jan 2017 16:11:00 -0500 (EST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.26 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:211234 Archived-At: Hello Emacs Devs. As ever, I've been hacking on the overlay tree branch. Now it's turned sour again though. For those it may concern this is the problem: The overlays in the tree are ordered first by their start position, if that is the same we look at the end position, if that is also equal we order by memory address. 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. My feeble attempts can be seen at https://github.com/jockej/emacs-mirror1, branch arne-without-parent. I've been wrestling with this for a while now. I'm starting to think this whole approach is... not so good. But if anyone has a brilliant idea I'd be glad to hear it :) Happy hacking! -- Joakim