From 96b2252a9fb1d29fbf6050f7663f74b6a3cfad0c Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 29 Aug 2023 15:00:05 -0600 Subject: [PATCH] [Emacs] Do org-window-habit repeats after logging the state change in logbook --- dotfiles/emacs.d/load.d/org-window-habit.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dotfiles/emacs.d/load.d/org-window-habit.el b/dotfiles/emacs.d/load.d/org-window-habit.el index 3562c320..18e6579d 100644 --- a/dotfiles/emacs.d/load.d/org-window-habit.el +++ b/dotfiles/emacs.d/load.d/org-window-habit.el @@ -539,13 +539,18 @@ (org-schedule nil target-time-string))) (defun org-window-habit-auto-repeat-maybe-advice (orig &rest args) - (apply orig args) - (when (and org-window-habit-mode (org-is-habit-p)) - (apply 'org-window-habit-auto-repeat args))) + (let ((res (apply orig args))) + (when (and org-window-habit-mode (org-is-habit-p)) + (apply 'org-window-habit-auto-repeat args)) + res)) (advice-add 'org-auto-repeat-maybe :around 'org-window-habit-auto-repeat-maybe-advice) +;; This seems to be the actually important annotation +(advice-add 'org-add-log-note + :around 'org-window-habit-auto-repeat-maybe-advice) + (defun org-window-habit-insert-consistency-graphs (&optional line) "Insert consistency graph for any habitual tasks." (let ((inhibit-read-only t)