]> err.no Git - dotfiles/commitdiff
Add clock rounding
authortfheen <tfheen@8da78d58-1cd3-0310-bee5-d77bd1b3e8bf>
Tue, 16 Jun 2009 08:08:16 +0000 (08:08 +0000)
committertfheen <tfheen@8da78d58-1cd3-0310-bee5-d77bd1b3e8bf>
Tue, 16 Jun 2009 08:08:16 +0000 (08:08 +0000)
git-svn-id: file:///svn/tfheen/trunk/dotfiles@1367 8da78d58-1cd3-0310-bee5-d77bd1b3e8bf

emacs

diff --git a/emacs b/emacs
index f38d29f7c5dcfb1fe3ec2d91fd8042421174f4b1..7f22eae00b29625784e13f318e2fac74a3dc5eda 100644 (file)
--- a/emacs
+++ b/emacs
        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
        (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))