[oni-org] Simplify org element property access
This commit is contained in:
parent
f460c3a19f
commit
1de5e3892c
1 changed files with 3 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue