From 4ad7ae2520695b5fa4c0d543fff07d0ae3816e5a Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Mon, 25 Dec 2023 15:56:03 +0100 Subject: [PATCH] lisp/org-element-ast.el: Add a comment why no `org-element-properties' --- lisp/org-element-ast.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/org-element-ast.el b/lisp/org-element-ast.el index f07a5f935..4c2f431fe 100644 --- a/lisp/org-element-ast.el +++ b/lisp/org-element-ast.el @@ -682,6 +682,12 @@ Return nil." (org-element-properties-resolve node (eq 'force undefer))) (org-element--properties-mapc fun node)) +;; There is purposely no function like `org-element-properties' that +;; returns a list of properties. Such function would tempt the users +;; to (1) run it, creating a whole new list; (2) filter over that list +;; - the process requiring a lot of extra consing, adding a load onto +;; Emacs GC, memory used, and slowing things up as creating new lists +;; is not free for CPU. (defsubst org-element-properties-map (fun node &optional undefer) "Apply FUN for each property of NODE and return a list of the results. FUN will be called with three arguments: property name, property