From 942b4d97c1fe253d51a60d87439a2886df03e493 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Sat, 10 Feb 2024 16:39:13 +0100 Subject: [PATCH] Revert "lisp/org-element-ast.el (org-element-property-raw): Simplify implementation" This reverts commit cfb48624f353dd7c44628dd1bdb7e08c0e2325a2. The commit is not compatible with Emacs 27, which is still supported. --- lisp/org-element-ast.el | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/lisp/org-element-ast.el b/lisp/org-element-ast.el index 22dfa45f6..6b98709d2 100644 --- a/lisp/org-element-ast.el +++ b/lisp/org-element-ast.el @@ -405,16 +405,26 @@ Ignore standard property array." Do not resolve deferred values. If PROPERTY is not present, return DFLT." (declare (pure t)) - (inline-letevals (node property) - (let ((idx (org-element--property-idx (inline-const-val property)))) - (inline-quote - (let ((idx (or ,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))))))) + (let ((idx (and (inline-const-p property) + (org-element--property-idx property)))) + (if idx + (inline-letevals (node) + (inline-quote + (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)))) + (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) "Initialize standard property array in NODE.