From 22526e5b586ab293e0b0472f586b0024bfe5a159 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Thu, 2 Jul 2020 20:10:01 -0400 Subject: [PATCH] FIX habit tracker now ignores CANC keyword --- etc/conf.org | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/etc/conf.org b/etc/conf.org index 3a490a3..e8a4a53 100644 --- a/etc/conf.org +++ b/etc/conf.org @@ -1814,6 +1814,16 @@ Aesthetically, I like all my keywords to have bold colors. ("HOLD" :foreground "violet" :weight bold) ("CANC" :foreground "deep sky blue" :weight bold))) #+END_SRC +**** habits +Habits consider any "done" todo keyword as "complete." I have =CANC= as a done keyword, which I don't want to be displayed as "complete" in the habit tracker. Override this hardcoded behavior with advice. +#+BEGIN_SRC emacs-lisp +(defun nd/org-habit-parse-todo-advice (orig-fn &rest args) + "Advice to make the habit tracker only mark DONE habits as complete." + (let ((org-done-keywords '("DONE"))) + (unwind-protect (apply orig-fn args)))) + +(advice-add #'org-habit-parse-todo :around #'nd/org-habit-parse-todo-advice) +#+END_SRC *** links and IDs :PROPERTIES: :ID: 9131356e-b290-402e-86cf-15242082c622