emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Emacs repo comment about org-element's use of avl-tree--*
@ 2018-01-19  3:11 Kyle Meyer
  2018-01-19 16:59 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Kyle Meyer @ 2018-01-19  3:11 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

The commit below was made in Emacs's master branch (fe15532eef).  I'm
posting it here for review/discussion rather than backporting it.

-- >8 --
From: Stefan Monnier <monnier@iro.umontreal.ca>
Date: Thu, 11 Jan 2018 11:33:03 -0500
Subject: [PATCH] * lisp/org/org-element.el: Add comment about use of internal
 functions

---
 lisp/org/org-element.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el
index 7a40d6933c..844349c2fc 100644
--- a/lisp/org/org-element.el
+++ b/lisp/org/org-element.el
@@ -4950,6 +4950,7 @@ org-element--cache-compare
 (defsubst org-element--cache-root ()
   "Return root value in cache.
 This function assumes `org-element--cache' is a valid AVL tree."
+  ;; FIXME: Why use internal functions of avl-tree?
   (avl-tree--node-left (avl-tree--dummyroot org-element--cache)))
 
 
@@ -4978,6 +4979,7 @@ org-element--cache-find
 		    (aref (car org-element--cache-sync-requests) 0)))
 	(node (org-element--cache-root))
 	lower upper)
+    ;; FIXME: Why use internal functions of avl-tree?
     (while node
       (let* ((element (avl-tree--node-data node))
 	     (begin (org-element-property :begin element)))
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: Emacs repo comment about org-element's use of avl-tree--*
  2018-01-19  3:11 Emacs repo comment about org-element's use of avl-tree--* Kyle Meyer
@ 2018-01-19 16:59 ` Nicolas Goaziou
  2018-01-20  5:44   ` Kyle Meyer
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2018-01-19 16:59 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: emacs-orgmode

Hello,

Kyle Meyer <kyle@kyleam.com> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Emacs repo comment about org-element's use of avl-tree--*
  2018-01-19 16:59 ` Nicolas Goaziou
@ 2018-01-20  5:44   ` Kyle Meyer
  0 siblings, 0 replies; 3+ messages in thread
From: Kyle Meyer @ 2018-01-20  5:44 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> 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.

OK, thanks for your response.

-- 
Kyle

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-20  5:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-19  3:11 Emacs repo comment about org-element's use of avl-tree--* Kyle Meyer
2018-01-19 16:59 ` Nicolas Goaziou
2018-01-20  5:44   ` Kyle Meyer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).