FIX remove ID property when refiling logbook

This commit is contained in:
Nathan Dwarshuis 2021-12-05 21:19:19 -05:00
parent c5b05047d2
commit fe3ce2248e
1 changed files with 13 additions and 11 deletions

View File

@ -1574,8 +1574,8 @@ and slow."
(error "No file associated to buffer")))) (error "No file associated to buffer"))))
(apath (s-join "/" (org-get-outline-path))) (apath (s-join "/" (org-get-outline-path)))
(atags (->> (org-get-tags) (atags (->> (org-get-tags)
(--filter (get-text-property 0 'inherited it)) (--filter (get-text-property 0 'inherited it))
(s-join " "))) (s-join " ")))
(add-context (-partial #'org-x--headline-add-archive-context (add-context (-partial #'org-x--headline-add-archive-context
afile apath acat atags)) afile apath acat atags))
(target (format "%s_archive" afile))) (target (format "%s_archive" afile)))
@ -1587,15 +1587,17 @@ and slow."
(-))) (-)))
(headline* (headline*
(->> (funcall add-context headline) (->> (funcall add-context headline)
;; close the headline (assume it isn't already) ;; remove the ID property if it exists
(org-ml-set-property :todo-keyword org-x-kw-done) (org-ml-headline-set-node-property "ID" nil)
(org-ml-headline-map-planning* ;; close the headline (assume it isn't already)
(let ((time (org-ml-unixtime-to-time-long (float-time)))) (org-ml-set-property :todo-keyword org-x-kw-done)
(org-ml-planning-set-timestamp! :closed time it))) (org-ml-headline-map-planning*
;; shift it to the top level (let ((time (org-ml-unixtime-to-time-long (float-time))))
(org-ml-shift-property :level level-shift) (org-ml-planning-set-timestamp! :closed time it)))
(org-ml-match-map* '(:any * headline) ;; shift it to the top level
(org-ml-shift-property :level level-shift it))))) (org-ml-shift-property :level level-shift)
(org-ml-match-map* '(:any * headline)
(org-ml-shift-property :level level-shift it)))))
;; TODO this currently does not refile under specific headlines ;; TODO this currently does not refile under specific headlines
(with-current-buffer (find-file-noselect target) (with-current-buffer (find-file-noselect target)
(org-ml-insert (point-max) headline*))))) (org-ml-insert (point-max) headline*)))))