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)) (goto-char (point-min))
(org-forward-heading-same-level 1) (org-forward-heading-same-level 1)
(let* ((element (org-element-at-point-no-context)) (let* ((element (org-element-at-point-no-context))
(element-data (when element (cadr element))) (element-title (org-element-property :raw-value element))
(element-title (when element-data (map-elt element-data :raw-value))) (contents-begin (org-element-property :contents-begin element))
(contents-begin (when element-data (map-elt element-data :contents-begin))) (contents-end (org-element-property :contents-end element)))
(contents-end (when element-data (map-elt element-data :contents-end))))
(when contents-begin (when contents-begin
(let ((text (buffer-substring-no-properties contents-begin contents-end))) (let ((text (buffer-substring-no-properties contents-begin contents-end)))
(delete-region contents-begin contents-end) (delete-region contents-begin contents-end)