emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kevin Buchs <kevin.buchs.junk@gmail.com>
To: Bastien <bzg@gnu.org>, Org Mode <emacs-orgmode@gnu.org>
Subject: forward to the past ... Rounding timeclock
Date: Thu, 15 Nov 2012 15:14:55 -0600	[thread overview]
Message-ID: <CAEqjYhuT8qFawbM=ZEKX0CFT2bPyZbTy+k3XqkTADR2yMG1ZGA@mail.gmail.com> (raw)

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.

             reply	other threads:[~2012-11-15 21:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-15 21:14 Kevin Buchs [this message]
2012-11-24 16:49 ` forward to the past ... Rounding timeclock Bernt Hansen
2012-12-29 17:46 ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEqjYhuT8qFawbM=ZEKX0CFT2bPyZbTy+k3XqkTADR2yMG1ZGA@mail.gmail.com' \
    --to=kevin.buchs.junk@gmail.com \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).