From 0211874488cab899d018f1b29987f1225a4efef2 Mon Sep 17 00:00:00 2001 From: tfheen Date: Tue, 16 Jun 2009 08:08:16 +0000 Subject: [PATCH] Add clock rounding git-svn-id: file:///svn/tfheen/trunk/dotfiles@1367 8da78d58-1cd3-0310-bee5-d77bd1b3e8bf --- emacs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/emacs b/emacs index f38d29f..7f22eae 100644 --- a/emacs +++ b/emacs @@ -338,7 +338,8 @@ org-agenda-align-tags-to-column (- (frame-width) 10) org-hide-leading-stars t org-agenda-files '("~/svn/plans/todo.org") - org-stuck-projects '("+LEVEL=2-neverstuck/-DONE" ("TODO" "NEXT" "NEXTACTION" "") ("APPOINTMENT") ""))) + org-stuck-projects '("+LEVEL=2-neverstuck/-DONE" ("TODO" "NEXT" "NEXTACTION" "") ("APPOINTMENT") "") + org-clock-into-drawer nil)) (eval-after-load 'remember @@ -453,3 +454,21 @@ (setq ts (+ ts (* 60 (third line)))) (setq tbl (cdr tbl)))))) + +(defadvice current-time (after tfheen-floor-current-time activate disable) + (setq ad-return-value (seconds-to-time (* 900 (floor (time-to-seconds ad-return-value) 900))))) +(defadvice org-clock-in (around tfheen-round-clock activate) + (ad-enable-advice 'current-time 'after 'tfheen-floor-current-time) + (ad-activate 'current-time) + ad-do-it + (ad-disable-advice 'current-time 'after 'tfheen-floor-current-time) + (ad-activate 'current-time)) + +(defadvice current-time (after tfheen-ceiling-current-time activate disable) + (setq ad-return-value (seconds-to-time (* 900 (ceiling (time-to-seconds ad-return-value) 900))))) +(defadvice org-clock-out (around tfheen-round-clock activate) + (ad-enable-advice 'current-time 'after 'tfheen-ceiling-current-time) + (ad-activate 'current-time) + ad-do-it + (ad-disable-advice 'current-time 'after 'tfheen-ceiling-current-time) + (ad-activate 'current-time)) -- 2.39.5