(chore): org-map-entries -> org-map-region (#2107)

org-map-entries is affected by agenda, while org-map-region is not
This commit is contained in:
Jethro Kuan
2022-02-26 18:07:45 -08:00
committed by GitHub
parent c8a360afdd
commit 62d311de22

View File

@@ -816,7 +816,8 @@ Any tags declared on #+FILETAGS: are transferred to tags on the new top heading.
Any top level properties drawers are incorporated into the new heading." Any top level properties drawers are incorporated into the new heading."
(interactive) (interactive)
(org-with-point-at 1 (org-with-point-at 1
(org-map-entries 'org-do-demote) (org-map-region #'org-do-demote
(point-min) (point-max))
(insert "* " (insert "* "
(org-roam--get-keyword "title") (org-roam--get-keyword "title")
"\n") "\n")
@@ -831,9 +832,11 @@ Converts a file containing a headline node at the top to a file
node." node."
(interactive) (interactive)
(org-with-point-at 1 (org-with-point-at 1
(org-map-entries (lambda () (org-map-region
(when (> (org-outline-level) 1) (lambda ()
(org-do-promote)))) (when (> (org-outline-level) 1)
(org-do-promote)))
(point-min) (point-max))
(let ((title (nth 4 (org-heading-components))) (let ((title (nth 4 (org-heading-components)))
(tags (nth 5 (org-heading-components)))) (tags (nth 5 (org-heading-components))))
(beginning-of-line) (beginning-of-line)