From: Ian Kelling <ianowl@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Fix incorrect time calculation for org-extend-today-until
Date: Sun, 15 Sep 2013 10:04:39 -0700 [thread overview]
Message-ID: <5235E8A7.8010704@gmail.com> (raw)
In-Reply-To: <5235E247.3020809@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 44 bytes --]
Updated patch, fixed commit message format.
[-- Attachment #2: 0001-Fix-incorrect-time-calculation-for-org-extend-today-.patch --]
[-- Type: text/x-patch, Size: 1255 bytes --]
From 0c23ccb9b00fd42f830f5a7472e2980b93c6040f Mon Sep 17 00:00:00 2001
From: Ian Kelling <ianowl@gmail.com>
Date: Sun, 15 Sep 2013 08:03:24 -0700
Subject: [PATCH] Fix incorrect time calculation for `org-extend-today-until'
* lisp/org-clock.el (org-clock-get-sum-start): Fix bad date
math, affecting mode line and clock tables.
TINYCHANGE
---
lisp/org-clock.el | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 9f22562..3195dc1 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1368,10 +1368,12 @@ decides which time to use."
(current-time))
((equal cmt "today")
(setq msg-extra "showing today's task time.")
- (let* ((dt (decode-time (current-time))))
- (setq dt (append (list 0 0 0) (nthcdr 3 dt)))
- (if org-extend-today-until
- (setf (nth 2 dt) org-extend-today-until))
+ (let* ((dt (decode-time (current-time)))
+ (hour (nth 2 dt))
+ (day (nth 3 dt)))
+ (if (< hour org-extend-today-until) (setf (nth 3 dt) (1- day)))
+ (setf (nth 2 dt) org-extend-today-until)
+ (setq dt (append (list 0 0) (nthcdr 2 dt)))
(apply 'encode-time dt)))
((or (equal cmt "all")
(and (or (not cmt) (equal cmt "auto"))
--
1.8.3.1
next prev parent reply other threads:[~2013-09-15 17:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-15 16:37 [PATCH] Fix incorrect time calculation for org-extend-today-until Ian Kelling
2013-09-15 17:04 ` Ian Kelling [this message]
2013-10-16 18:58 ` Ian Kelling
2013-10-17 5:42 ` Carsten Dominik
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=5235E8A7.8010704@gmail.com \
--to=ianowl@gmail.com \
--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).