1
0
Fork 0

[oni-org] Simplify org element property access

This commit is contained in:
Tom Willemse 2023-04-11 20:20:28 -07:00
parent f460c3a19f
commit 1de5e3892c

View file

@ -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)