emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* forward to the past ... Rounding timeclock
@ 2012-11-15 21:14 Kevin Buchs
  2012-11-24 16:49 ` Bernt Hansen
  2012-12-29 17:46 ` Bastien
  0 siblings, 2 replies; 3+ messages in thread
From: Kevin Buchs @ 2012-11-15 21:14 UTC (permalink / raw)
  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 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
<kevin.buchs.junk@gmail.com> wrote:
> On Thu, May 24, 2012 at 4:25 AM, Bastien <bzg@gnu.org> 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: forward to the past ... Rounding timeclock
  2012-11-15 21:14 forward to the past ... Rounding timeclock Kevin Buchs
@ 2012-11-24 16:49 ` Bernt Hansen
  2012-12-29 17:46 ` Bastien
  1 sibling, 0 replies; 3+ messages in thread
From: Bernt Hansen @ 2012-11-24 16:49 UTC (permalink / raw)
  To: Kevin Buchs; +Cc: Bastien, Org Mode

Kevin Buchs <kevin.buchs.junk@gmail.com> writes:

> (By the way, what is the best way (right way) to produce a patch
> listing? This was all I could come up with).

http://orgmode.org/worg/org-contribute.html#sec-4

Regards,
Bernt

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: forward to the past ... Rounding timeclock
  2012-11-15 21:14 forward to the past ... Rounding timeclock Kevin Buchs
  2012-11-24 16:49 ` Bernt Hansen
@ 2012-12-29 17:46 ` Bastien
  1 sibling, 0 replies; 3+ messages in thread
From: Bastien @ 2012-12-29 17:46 UTC (permalink / raw)
  To: Kevin Buchs; +Cc: Org Mode

Hi Kevin,

Kevin Buchs <kevin.buchs.junk@gmail.com> writes:

> 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

There is now `org-clock-rounding-minutes' in git master, the new
option will be available in 8.0.  You can also set it to a symbol
if you want to fall back on `org-time-stamp-rounding-minutes'.

The patch was not complete, but thanks for the effort and thanks
for suggesting this feature!

Best,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-12-29 17:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-15 21:14 forward to the past ... Rounding timeclock Kevin Buchs
2012-11-24 16:49 ` Bernt Hansen
2012-12-29 17:46 ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).