mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-13 10:10:09 +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:
parent
80e7c9f80f
commit
942b4d97c1
|
@ -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))))
|
||||||
|
(if idx
|
||||||
|
(inline-letevals (node)
|
||||||
(inline-quote
|
(inline-quote
|
||||||
(let ((idx (or ,idx (org-element--property-idx ,property))))
|
(if-let ((parray (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))))
|
||||||
|
(inline-letevals (node property)
|
||||||
|
(inline-quote
|
||||||
|
(let ((idx (org-element--property-idx ,property)))
|
||||||
(if-let ((parray (and idx (org-element--parray ,node))))
|
(if-let ((parray (and idx (org-element--parray ,node))))
|
||||||
(pcase (aref parray idx)
|
(pcase (aref parray idx)
|
||||||
(`org-element-ast--nil ,dflt)
|
(`org-element-ast--nil ,dflt)
|
||||||
(val val))
|
(val val))
|
||||||
;; No property array exists. Fall back to `plist-get'.
|
;; No property array exists. Fall back to `plist-get'.
|
||||||
(org-element--plist-property ,property ,node ,dflt)))))))
|
(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.
|
||||||
|
|
Loading…
Reference in a new issue