diff options
| author | Raúl Benencia <id@rbenencia.name> | 2025-12-28 11:40:49 -0300 |
|---|---|---|
| committer | Raúl Benencia <id@rbenencia.name> | 2025-12-28 11:40:49 -0300 |
| commit | 4a59cbc0765c30f632ccd7bc5c73f72e2d840d11 (patch) | |
| tree | cf013850b55b031539279ce877db128709b5288c | |
| parent | 0eb787961c5c1e6dad18d0613dcd19ecadebd9fe (diff) | |
Show task effort
| -rw-r--r-- | org-tempus.el | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/org-tempus.el b/org-tempus.el index 0d2f379..f3014e4 100644 --- a/org-tempus.el +++ b/org-tempus.el @@ -231,6 +231,18 @@ Known providers are `emacs' (activity inside Emacs), "Return clocked time for current task as a duration string." (org-duration-from-minutes (org-clock-get-clocked-time))) +(defun org-tempus--current-task-effort () + "Return effort for current task as a duration string, or nil." + (let ((marker (and (org-clock-is-active) org-clock-marker))) + (when (and marker (marker-buffer marker)) + (with-current-buffer (marker-buffer marker) + (when (derived-mode-p 'org-mode) + (org-with-point-at marker + (let ((effort (org-entry-get nil "EFFORT"))) + (when effort + (org-duration-from-minutes + (org-duration-to-minutes effort)))))))))) + (defun org-tempus-reset-session () "Reset the current session timer." (interactive) @@ -396,6 +408,10 @@ A session does not reset when switching tasks within "] (" (org-tempus--current-task-name) " <" (org-tempus--current-task-time) + (let ((effort (org-tempus--current-task-effort))) + (if effort + (concat "/" effort) + "")) ">)")) (let* ((break-seconds (org-tempus--current-break-duration)) (break-str (when break-seconds |
