FIX make new ID for each cloned headline

This commit is contained in:
Nathan Dwarshuis 2022-01-30 14:25:28 -05:00
parent ca2d4d54f9
commit 04c177216c
1 changed files with 12 additions and 13 deletions

View File

@ -2082,8 +2082,6 @@ This includes unchecking all checkboxes, marking keywords as
;; remove CLOSED planning entry ;; remove CLOSED planning entry
(org-ml-headline-map-planning* (org-ml-headline-map-planning*
(-some->> it (org-ml-planning-set-timestamp! :closed nil))) (-some->> it (org-ml-planning-set-timestamp! :closed nil)))
;; remove ID property
(org-ml-headline-set-node-property "ID" (org-id-new))
;; clear item checkboxes ;; clear item checkboxes
(org-ml-match-map* '(section :any * item) (org-ml-match-map* '(section :any * item)
(org-ml-set-property :checkbox 'off it)) (org-ml-set-property :checkbox 'off it))
@ -2139,7 +2137,8 @@ timestamp in the contents of the headline will be shifted."
"Return HEADLINE repeated and shifted by OFFSET UNITs N times." "Return HEADLINE repeated and shifted by OFFSET UNITs N times."
(->> (org-ml-clone-node-n n headline) (->> (org-ml-clone-node-n n headline)
(--map-indexed (org-x--subtree-shift-timestamps (--map-indexed (org-x--subtree-shift-timestamps
(* offset (1+ it-index)) unit it)))) (* offset (1+ it-index)) unit it))
(--map (org-ml-headline-set-node-property "ID" (org-id-new) it))))
(defun org-x-clone-subtree-with-time-shift (n) (defun org-x-clone-subtree-with-time-shift (n)
"Like `org-clone-subtree-with-time-shift' except reset items and todos. "Like `org-clone-subtree-with-time-shift' except reset items and todos.