lisp/org-element-ast.el: Add a comment why no `org-element-properties'

This commit is contained in:
Ihor Radchenko 2023-12-25 15:56:03 +01:00
parent bd9dc32178
commit 4ad7ae2520
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 6 additions and 0 deletions

View File

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