From cf3bb8eed34a229abd7f00e64d51fea9b5c30168 Mon Sep 17 00:00:00 2001 From: BardofSprites <89086143+BardofSprites@users.noreply.github.com> Date: Sat, 17 Aug 2024 17:08:13 -0400 Subject: huge org clock upgrade --- bard-emacs-modules/bard-emacs-org.el | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) (limited to 'bard-emacs-modules') diff --git a/bard-emacs-modules/bard-emacs-org.el b/bard-emacs-modules/bard-emacs-org.el index ce906fa..98ab264 100644 --- a/bard-emacs-modules/bard-emacs-org.el +++ b/bard-emacs-modules/bard-emacs-org.el @@ -107,24 +107,43 @@ ;;; Org Agenda ;; clock tables -(setq org-clock-clocktable-default-properties '(:maxlevel 7 :scope agenda)) +(setq org-clock-clocktable-default-properties '(:maxlevel 7 :scope agenda) + org-clock-persist 'history) +(org-clock-persistence-insinuate) (defun bard/org-clock-report () (interactive) (bard/new-org-buffer) (org-clock-report)) +(use-package org-mode + :demand t + :config + (defun bard/org-clock-update-mode-line () + (setq org-mode-line-string nil) + (force-mode-line-update)) + :hook + ((org-clock-out . bard/org-clock-update-mode-line))) + +(defun bard/org-clock-task-string () + "Return a simplified org clock task string." + (if (and (boundp 'org-mode-line-string) + (not (string-equal "" org-mode-line-string)) + org-mode-line-string) + (substring-no-properties org-mode-line-string) + "No task clocked in")) + (defun bard/choose-agenda () "For viewing my custom agenda" (interactive) (let ((agenda-views '("Default" "Monthly" "Yearly"))) (setq chosen-view (completing-read "Choose an agenda view: " agenda-views)) - (cond - ((string= chosen-view "Yearly") - (org-agenda nil "Y")) - ((string= chosen-view "Monthly") - (org-agenda nil "M")) - ((string= chosen-view "Default") - (org-agenda nil "D"))))) + (cond + ((string= chosen-view "Yearly") + (org-agenda nil "Y")) + ((string= chosen-view "Monthly") + (org-agenda nil "M")) + ((string= chosen-view "Default") + (org-agenda nil "D"))))) (global-set-key (kbd "M-") 'bard/choose-agenda) (global-set-key (kbd "C-c a c") 'bard/choose-agenda) -- cgit v1.2.3