-
-
Save dmitrym0/ba0045fff7b270f8ed70d8d6142abd5b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun dm/goto-tasks-heading () | |
"Find the tasks heading" | |
(search-forward "* Tasks")) | |
(defun dm/get-todays-daily-file () | |
"Gets the path to today's daily file" | |
(let* ((daily-file (format "%s.org" (format-time-string "%Y-%m-%d"))) | |
(full-path (concat org-roam-directory "/" org-roam-dailies-directory daily-file ))) | |
full-path) | |
) | |
(defun dm/move-task-to-today-and-reset-schedule () | |
"Moves a task from an old daily note to today's note" | |
(interactive) | |
(let* ((daily-file (dm/get-todays-daily-file))) | |
(save-window-excursion | |
(when (string-equal "org-agenda-mode" major-mode) | |
(org-agenda-goto)) | |
(org-cut-subtree) | |
(find-file daily-file) | |
(goto-line 1) | |
(dm/goto-tasks-heading) | |
(org-paste-subtree) | |
(org-schedule nil (format-time-string "%Y-%m-%d 12:00")) | |
) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment