From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: [Accepted] [Orgmode,2/4] org-habit: Use org-today. Date: Wed, 1 Dec 2010 00:49:45 +0100 (CET) Message-ID: <20101130234945.283197962F1@carsten-dominiks-macbook-pro.local> References: <1291040314-1884-2-git-send-email-julien@danjou.info> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=52176 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PO9eF-0000w3-IM for emacs-orgmode@gnu.org; Thu, 02 Dec 2010 08:58:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PO9cN-0004bY-AX for emacs-orgmode@gnu.org; Thu, 02 Dec 2010 08:56:33 -0500 Received: from ehef114.hef.ru.nl ([131.174.192.114]:54007) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PO9cM-0004SF-Tt for emacs-orgmode@gnu.org; Thu, 02 Dec 2010 08:54:39 -0500 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Patch 418 (http://patchwork.newartisans.com/patch/418/) is now "Accepted". Maintainer comment: No comment This relates to the following submission: http://mid.gmane.org/%3C1291040314-1884-2-git-send-email-julien%40danjou.info%3E Here is the original message containing the patch: > Content-Type: text/plain; charset="utf-8" > MIME-Version: 1.0 > Content-Transfer-Encoding: 7bit > Subject: [Orgmode,2/4] org-habit: Use org-today. > Date: Mon, 29 Nov 2010 19:18:32 -0000 > From: Julien Danjou > X-Patchwork-Id: 418 > Message-Id: <1291040314-1884-2-git-send-email-julien@danjou.info> > To: emacs-orgmode@gnu.org > Cc: Julien Danjou > > * org-habit.el: Use org-today. > > Signed-off-by: Julien Danjou > > --- > lisp/org-habit.el | 10 +++------- > 1 files changed, 3 insertions(+), 7 deletions(-) > > diff --git a/lisp/org-habit.el b/lisp/org-habit.el > index 394b4fb..04a2328 100644 > --- a/lisp/org-habit.el > +++ b/lisp/org-habit.el > @@ -197,10 +197,7 @@ This list represents a \"habit\" for the rest of this module." > "Determine the relative priority of a habit. > This must take into account not just urgency, but consistency as well." > (let ((pri 1000) > - (now (time-to-days > - (or moment > - (time-subtract (current-time) > - (list 0 (* 3600 org-extend-today-until) 0))))) > + (now (if moment (time-to-days moment) (org-today))) > (scheduled (org-habit-scheduled habit)) > (deadline (org-habit-deadline habit))) > ;; add 10 for every day past the scheduled date, and subtract for every > @@ -240,7 +237,7 @@ Habits are assigned colors on the following basis: > (deadline (if scheduled-days > (+ scheduled-days (- d-repeat s-repeat)) > (org-habit-deadline habit))) > - (m-days (or now-days (time-to-days (current-time))))) > + (m-days (or now-days (org-today)))) > (cond > ((< m-days scheduled) > '(org-habit-clear-face . org-habit-clear-future-face)) > @@ -319,8 +316,7 @@ current time." > "Insert consistency graph for any habitual tasks." > (let ((inhibit-read-only t) l c > (buffer-invisibility-spec '(org-link)) > - (moment (time-subtract (current-time) > - (list 0 (* 3600 org-extend-today-until) 0)))) > + (moment (days-to-time (org-today)))) > (save-excursion > (goto-char (if line (point-at-bol) (point-min))) > (while (not (eobp)) >