From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Buchs Subject: forward to the past ... Rounding timeclock Date: Thu, 15 Nov 2012 15:14:55 -0600 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:60527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZ6m3-00029a-Tl for emacs-orgmode@gnu.org; Thu, 15 Nov 2012 16:15:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TZ6m0-000227-RY for emacs-orgmode@gnu.org; Thu, 15 Nov 2012 16:14:59 -0500 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien , Org Mode Org-modians, I would like clocking to round to 15 minute intervals when I clock in and clock out. I have the following in .emacs custom-set-variables section: '(org-time-stamp-rounding-minutes (quote (15 15))) My org-version is 7.8.11 and emacs is 24.2.50.1 The rounding operates just fine when I go to adjust clock times (S-Up/Down) making the adjustment to the nearest 15 minute interval. However, when I clock-in or clock-out, it uses the time, down to the minute. Here is what I found fixes this behavior for me: *** h:/lib/emacs/org-mode/org-clock.el Thu Nov 8 17:24:54 2012 --- h:/lib/emacs/org-mode/org-clock-kevin.el Fri Nov 9 11:47:40 2012 *************** *** 1239,1249 **** (y-or-n-p (format "You stopped another clock %d mins ago; start this one from the= n? " ! (/ (- (org-float-time (current-time)) (org-float-time leftover)) 60))) leftover) start-time ! (current-time))) (setq ts (org-insert-time-stamp org-clock-start-time 'with-hm 'inactive)))) (move-marker org-clock-marker (point) (buffer-base-buffer)) --- 1239,1249 ---- (y-or-n-p (format "You stopped another clock %d mins ago; start this one from the= n? " ! (/ (- (org-float-time (org-current-time)) (org-float-time leftover)) 60))) leftover) start-time ! (org-current-time))) (setq ts (org-insert-time-stamp org-clock-start-time 'with-hm 'inactive)))) (move-marker org-clock-marker (point) (buffer-base-buffer)) (By the way, what is the best way (right way) to produce a patch listing? This was all I could come up with). - Kevin Buchs On Thu, May 24, 2012 at 11:11 AM, Kevin Buchs wrote: > On Thu, May 24, 2012 at 4:25 AM, Bastien wrote: >> >> What is your value of =CC=80org-time-stamp-rounding-minutes'? > > It is (15 15). >> >> Replacing (current-time) with (org-current-time) here will surprise >> users that use =CC=80org-time-stamp-rounding-minutes' only for modifying >> time-stamps and not for clocking in. >> >> We could have an option for this, letting users decide whether they >> want `org-time-stamp-rounding-minutes' to apply to clocking in. Do >> you want to work in this direction? >> > According to the documentation for org-time-stamp-rounding-minutes, the > first value of that list should apply to creating time stamps and the sec= ond > to modifying them. Does that differentiation cover the case you gave? If = we > need to create another sort of encoding for org-time-stamp-rounding-minut= es, > I can certainly work on coding that. I find this feature really useful. > Perhaps I misunderstand, but it seems like one still needs to replace > (current-time) with (org-current-time) as org-current-time is where the > value of org-time-stamp-rounding-minutes is actually utilized. >> >> > I have filled out the paperwork with FSF to be a developer in emacs/ >> > org-mode. >> >> Let us know when this is done. >> > It is already done - been so for a few months.