emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] forward to the past ... Rounding timeclock


From: Kevin Buchs
Subject: [O] forward to the past ... Rounding timeclock
Date: Thu, 15 Nov 2012 15:14:55 -0600

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 then? "
!                              (/ (- (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 then? "
!                              (/ (- (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
<address@hidden> wrote:
> On Thu, May 24, 2012 at 4:25 AM, Bastien <address@hidden> wrote:
>>
>> What is your value of ̀org-time-stamp-rounding-minutes'?
>
> It is  (15 15).
>>
>> Replacing (current-time) with (org-current-time) here will surprise
>> users that use ̀org-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 second
> 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-minutes,
> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]