diff --git a/org/config-org-agendas.el b/org/config-org-agendas.el index 39088e9..e6bfbaf 100644 --- a/org/config-org-agendas.el +++ b/org/config-org-agendas.el @@ -16,12 +16,17 @@ ) ) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; set org habit status for yesterday and schedule for today. this is to facilitate adding "skipped" log entries for better reporting and tracking of habits +; this assumes youre operating on daily habits ; https://emacs.stackexchange.com/questions/9433/how-to-make-org-prompt-for-a-timestamp-when-changing-state-of-a-todo/63809 ; https://stackoverflow.com/questions/25437069/how-can-i-mark-org-habits-as-done-in-the-past (defun kmn/org-habit-with-date (&optional arg) (interactive "P") + (setq my-activation-time (current-time)) (cl-letf* ((org-read-date-prefer-future nil) - (my-current-time (org-read-date t t nil "when:" nil nil nil)) + (org-popup-calendar-for-date-prompt nil) + (my-current-time (org-read-date t t nil "when:" nil "-1d" nil)) ((symbol-function 'current-time) #'(lambda () my-current-time)) ((symbol-function 'org-today) @@ -38,9 +43,9 @@ (funcall super-org-entry-put pom property my-value)) (funcall super-org-entry-put pom property value) )))) - (if (eq major-mode 'org-agenda-mode) (org-agenda-todo arg) (org-todo arg)) + (if (eq major-mode 'org-agenda-mode) (org-agenda-todo arg) (org-todo arg)) ) - (org-schedule arg (format-time-string "%Y-%m-%d")) + (if (eq major-mode 'org-agenda-mode) (org-agenda-schedule arg my-activation-time) (org-schedule arg my-activation-time) ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;