From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Emacs repo comment about org-element's use of avl-tree--* Date: Fri, 19 Jan 2018 17:59:43 +0100 Message-ID: <87po65pyww.fsf@nicolasgoaziou.fr> References: <87zi5a35m7.fsf@kyleam.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eca16-0002z5-0d for emacs-orgmode@gnu.org; Fri, 19 Jan 2018 11:59:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eca15-0004zm-1w for emacs-orgmode@gnu.org; Fri, 19 Jan 2018 11:59:48 -0500 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:49833) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eca14-0004zN-Rp for emacs-orgmode@gnu.org; Fri, 19 Jan 2018 11:59:46 -0500 In-Reply-To: <87zi5a35m7.fsf@kyleam.com> (Kyle Meyer's message of "Thu, 18 Jan 2018 22:11:12 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Kyle Meyer Cc: emacs-orgmode@gnu.org Hello, Kyle Meyer writes: > The commit below was made in Emacs's master branch (fe15532eef). I'm > posting it here for review/discussion rather than backporting it. [...] > + ;; FIXME: Why use internal functions of avl-tree? > (avl-tree--node-left (avl-tree--dummyroot org-element--cache))) [...] > + ;; FIXME: Why use internal functions of avl-tree? > (while node > (let* ((element (avl-tree--node-data node)) > (begin (org-element-property :begin element))) IIRC, this is because external functions do not give enough control over the tree. For example, the code needs to be able to find a node whose key matches a given predicate, efficiently. This is not much of an issue, however. This implementation detail may change at some point. Regards, -- Nicolas Goaziou