]> git.eshelyaron.com Git - emacs.git/commitdiff
Address FIXME in org-element-create
authorStefan Kangas <stefankangas@gmail.com>
Mon, 17 Feb 2025 01:04:31 +0000 (02:04 +0100)
committerEshel Yaron <me@eshelyaron.com>
Tue, 18 Feb 2025 08:45:30 +0000 (09:45 +0100)
* lisp/org/org-element-ast.el (org-element-create): Address FIXME.

(cherry picked from commit b417c0abebfa68d37dd07160b81ce5f7da6dd431)

lisp/org/org-element-ast.el

index 5e1a93a2417d67b40e3d2dcbf1a6597255c1c8c8..d33525b102fc13a07b17b795921dea5567039718 100644 (file)
@@ -735,10 +735,10 @@ a newly created one.
 When TYPE is `plain-text', CHILDREN must contain a single node -
 string.  Alternatively, TYPE can be a string.  When TYPE is nil or
 `anonymous', PROPS must be nil."
-  (cl-assert
-   ;; FIXME: Just use `plistp' from Emacs 29 when available.
-   (let ((len (proper-list-p props)))
-     (and len (cl-evenp len))))
+  (cl-assert (if (fboundp 'plistp) ; Emacs 29.1
+                 (plistp props)
+               (let ((len (proper-list-p props)))
+                 (and len (cl-evenp len)))))
   ;; Assign parray.
   (when (and props (not (stringp type)) (not (eq type 'plain-text)))
     (let ((node (list 'dummy props)))