From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Kelling Subject: Re: [PATCH] Fix incorrect time calculation for org-extend-today-until Date: Sun, 15 Sep 2013 10:04:39 -0700 Message-ID: <5235E8A7.8010704@gmail.com> References: <5235E247.3020809@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070907050005080303040203" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46709) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLFkg-0003YF-8o for emacs-orgmode@gnu.org; Sun, 15 Sep 2013 13:04:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VLFkX-0005yW-QH for emacs-orgmode@gnu.org; Sun, 15 Sep 2013 13:04:50 -0400 Received: from mail-pd0-x22a.google.com ([2607:f8b0:400e:c02::22a]:50066) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLFkX-0005xy-Im for emacs-orgmode@gnu.org; Sun, 15 Sep 2013 13:04:41 -0400 Received: by mail-pd0-f170.google.com with SMTP id x10so3213486pdj.1 for ; Sun, 15 Sep 2013 10:04:40 -0700 (PDT) In-Reply-To: <5235E247.3020809@gmail.com> 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: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------070907050005080303040203 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Updated patch, fixed commit message format. --------------070907050005080303040203 Content-Type: text/x-patch; name="0001-Fix-incorrect-time-calculation-for-org-extend-today-.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Fix-incorrect-time-calculation-for-org-extend-today-.pa"; filename*1="tch" >From 0c23ccb9b00fd42f830f5a7472e2980b93c6040f Mon Sep 17 00:00:00 2001 From: Ian Kelling 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 --------------070907050005080303040203--