diff options
| -rw-r--r-- | bard-elisp/bard-calendar.el | 13 | ||||
| -rw-r--r-- | bard-emacs-modules/bard-emacs-calendar.el | 8 |
2 files changed, 19 insertions, 2 deletions
diff --git a/bard-elisp/bard-calendar.el b/bard-elisp/bard-calendar.el index 1e3cdb2..b32b9db 100644 --- a/bard-elisp/bard-calendar.el +++ b/bard-elisp/bard-calendar.el @@ -1,5 +1,18 @@ +(require 'org) + ;; Org Clock +(defun bard/auto-clock-in () + "Automatically clock in when task marked in progress (INPROG)." + (when (equal (org-get-todo-state) "INPROG") + (org-clock-in)) + (when (equal (org-get-todo-state) "DONE") + (org-clock-out))) + +(defun test-func () + (interactive) + (message (org-get-todo-state))) + (defun bard/org-clock-report () (interactive) (bard/new-org-buffer) diff --git a/bard-emacs-modules/bard-emacs-calendar.el b/bard-emacs-modules/bard-emacs-calendar.el index ce7a556..bbb7a73 100644 --- a/bard-emacs-modules/bard-emacs-calendar.el +++ b/bard-emacs-modules/bard-emacs-calendar.el @@ -14,11 +14,15 @@ ;; Org todo keywords - changed to using hl-todo faces fixed by modus/ef themes (setq org-todo-keywords - '((sequence "TODO(t)" "EXTRA(e)" "|" "DONE(d)" "KILLED(k)") + '((sequence "TODO(t)" "EXTRA(e)" "INPROG(i)" "|" "DONE(d)" "KILLED(k)") (sequence "MEET(m)" "|" "MET(M)"))) (setq org-todo-keyword-faces - '(("EXTRA" . (:inherit warning)))) + '(("EXTRA" . (:inherit warning)) + ("INPROG" . (:inherit hi-yellow :weight bold)))) + +;; Automatically clock in +(add-hook 'org-after-todo-state-change-hook #'bard/auto-clock-in) ;;; Org Agenda |
