diff options
| author | Raúl Benencia <id@rbenencia.name> | 2026-01-13 10:52:45 -0300 |
|---|---|---|
| committer | Raúl Benencia <id@rbenencia.name> | 2026-01-13 10:52:45 -0300 |
| commit | 49849b3a82cf198cb56b836eba4a38635988fd5c (patch) | |
| tree | 437801b2a34bcfb9d32a76eac79842767e2826bf | |
| parent | 68084466c23e7fca23e6c55e08638bef6c4b78d5 (diff) | |
feat: inform break time when auto clock in
| -rw-r--r-- | org-tempus.el | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/org-tempus.el b/org-tempus.el index fe101ad..bc5aa0b 100644 --- a/org-tempus.el +++ b/org-tempus.el @@ -732,6 +732,15 @@ Return non-nil when clock-in succeeds." (org-tempus--notify msg) t)) +(defun org-tempus--auto-clock-in-message (base) + "Return notification message using BASE with optional break time." + (let ((break-seconds (org-tempus--current-break-duration))) + (if break-seconds + (format "%s after %s break" + base + (org-duration-from-minutes (/ break-seconds 60.0))) + base))) + (defun org-tempus--maybe-auto-clock-in (&optional start-time) "Auto clock in to the last task if eligible. When START-TIME is non-nil, use it as the clock-in time. @@ -746,7 +755,8 @@ Return non-nil when an auto clock-in occurs." (org-tempus--auto-clock-in #'org-tempus--clock-in-last start-time - "Auto clocked in to your last task.") + (org-tempus--auto-clock-in-message + "Auto clocked in to your last task")) (org-tempus--debug "Skipping auto clock-in (last task): window expired (%.1fs)" since))))) @@ -771,7 +781,8 @@ Return non-nil when an auto clock-in occurs." (org-tempus--auto-clock-in #'org-tempus--clock-in-default start-time - "Auto clocked in to your default task.") + (org-tempus--auto-clock-in-message + "Auto clocked in to your default task")) (org-tempus--debug "Skipping auto clock-in (default): Org ID not found")))) (defun org-tempus--maybe-update-dconf (&optional value) |
