org-element-ast: New function `org-element-put-property-2'

* lisp/org-element-ast.el (org-element-put-property-2): New function
allowing to pass NODE as the last argument.
This commit is contained in:
Ihor Radchenko 2023-04-29 12:02:55 +02:00
parent 80122a1204
commit ae49451364
No known key found for this signature in database
GPG key ID: 6470762A7DA11D8B

View file

@ -466,6 +466,11 @@ Return modified NODE."
(setcar (cdr ,node) (plist-put (nth 1 ,node) ,property ,value)))))
,node))))))
(define-inline org-element-put-property-2 (property value node)
"Like `org-element-put-property', but NODE is the last argument.
See `org-element-put-property' for the meaning of PROPERTY and VALUE."
(inline-quote (org-element-put-property ,node ,property ,value)))
(defun org-element--property (property node &optional dflt force-undefer)
"Extract the value from the PROPERTY of a NODE.
Return DFLT when PROPERTY is not present.