org mode - How to refile into a datetree - Emacs Stack Exchange
Tags
- :orgmode:emacs:chronological:
(defun my/org-read-datetree-date (d)
"Parse a time string D and return a date to pass to the datetree functions."
(let ((dtmp (nthcdr 3 (parse-time-string d))))
(list (cadr dtmp) (car dtmp) (caddr dtmp))))
(defun my/org-refile-to-archive-datetree ()
"Refile an entry to a datetree under an archive."
(interactive)
(require 'org-datetree)
(let ((datetree-date (my/org-read-datetree-date (org-read-date t nil))))
(org-refile nil nil (list nil (buffer-file-name) nil
(save-excursion
(org-datetree-find-date-create datetree-date)))))
(setq this-command 'my/org-refile-to-journal))
used the above to refile into the blotter before I decided that the blotter should just be appended to.