0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-25 22:32:51 +00:00

Revert "lisp/org-element-ast.el (org-element-property-raw): Simplify implementation"

This reverts commit cfb48624f3.

The commit is not compatible with Emacs 27, which is still supported.
This commit is contained in:
Ihor Radchenko 2024-02-10 16:39:13 +01:00
parent 80e7c9f80f
commit 942b4d97c1
No known key found for this signature in database
GPG key ID: 6470762A7DA11D8B

View file

@ -405,16 +405,26 @@ Ignore standard property array."
Do not resolve deferred values. Do not resolve deferred values.
If PROPERTY is not present, return DFLT." If PROPERTY is not present, return DFLT."
(declare (pure t)) (declare (pure t))
(inline-letevals (node property) (let ((idx (and (inline-const-p property)
(let ((idx (org-element--property-idx (inline-const-val property)))) (org-element--property-idx property))))
(inline-quote (if idx
(let ((idx (or ,idx (org-element--property-idx ,property)))) (inline-letevals (node)
(if-let ((parray (and idx (org-element--parray ,node)))) (inline-quote
(pcase (aref parray idx) (if-let ((parray (org-element--parray ,node)))
(`org-element-ast--nil ,dflt) (pcase (aref parray ,idx)
(val val)) (`org-element-ast--nil ,dflt)
;; No property array exists. Fall back to `plist-get'. (val val))
(org-element--plist-property ,property ,node ,dflt))))))) ;; No property array exists. Fall back to `plist-get'.
(org-element--plist-property ,property ,node ,dflt))))
(inline-letevals (node property)
(inline-quote
(let ((idx (org-element--property-idx ,property)))
(if-let ((parray (and idx (org-element--parray ,node))))
(pcase (aref parray idx)
(`org-element-ast--nil ,dflt)
(val val))
;; No property array exists. Fall back to `plist-get'.
(org-element--plist-property ,property ,node ,dflt))))))))
(define-inline org-element--put-parray (node &optional parray) (define-inline org-element--put-parray (node &optional parray)
"Initialize standard property array in NODE. "Initialize standard property array in NODE.