From 1de5e3892cd22f3c2324865753149769afd3b2c3 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Tue, 11 Apr 2023 20:20:28 -0700 Subject: [PATCH] [oni-org] Simplify org element property access --- oni-org/oni-org.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/oni-org/oni-org.el b/oni-org/oni-org.el index 7164040..7a95721 100644 --- a/oni-org/oni-org.el +++ b/oni-org/oni-org.el @@ -1083,10 +1083,9 @@ placed above TARGET. Otherwise it will be placed below it." (goto-char (point-min)) (org-forward-heading-same-level 1) (let* ((element (org-element-at-point-no-context)) - (element-data (when element (cadr element))) - (element-title (when element-data (map-elt element-data :raw-value))) - (contents-begin (when element-data (map-elt element-data :contents-begin))) - (contents-end (when element-data (map-elt element-data :contents-end)))) + (element-title (org-element-property :raw-value element)) + (contents-begin (org-element-property :contents-begin element)) + (contents-end (org-element-property :contents-end element))) (when contents-begin (let ((text (buffer-substring-no-properties contents-begin contents-end))) (delete-region contents-begin contents-end)