From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Problem with hourly repeater Date: Wed, 10 Oct 2012 16:14:38 +0200 Message-ID: <871uh65s8h.fsf@gmail.com> References: <874nm5avug.fsf@mean.albasani.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:58761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLx7d-0002I1-TQ for emacs-orgmode@gnu.org; Wed, 10 Oct 2012 10:18:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TLx7Y-0007dj-0v for emacs-orgmode@gnu.org; Wed, 10 Oct 2012 10:18:53 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:46089) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLx7X-0007dT-Qu for emacs-orgmode@gnu.org; Wed, 10 Oct 2012 10:18:47 -0400 Received: by mail-wi0-f171.google.com with SMTP id hj13so5807159wib.12 for ; Wed, 10 Oct 2012 07:18:47 -0700 (PDT) In-Reply-To: <874nm5avug.fsf@mean.albasani.net> (Memnon Anon's message of "Mon, 8 Oct 2012 14:37:36 +0000 (UTC)") 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: Memnon Anon Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hello, Memnon Anon writes: > I am trying the hourly repeaters and see a problem. [...] > Anyone else see this? Yes, I confirm the bug. Would you mind testing the following patch and tell me if it fixes the problem without adding unwanted side-effects? Thank you. Regards, -- Nicolas Goaziou --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Fix-bug-related-to-agenda-bulding-with-hour-repeater.patch Content-Description: fix hour repeaters >From 3576891ba04992328576c1ea84a8958e4c0fa16c Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 10 Oct 2012 16:11:41 +0200 Subject: [PATCH] Fix bug related to agenda bulding with hour repeaters * lisp/org.el: Make `org-closest-date' aware of hours repeaters. --- lisp/org.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 59683bc..c69f0f3 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -16157,7 +16157,12 @@ When PREFER is `future', return a date that is either CURRENT or future. When SHOW-ALL is nil, only return the current occurrence of a time stamp." ;; Make the proper lists from the dates (catch 'exit - (let ((a1 '(("d" . day) ("w" . week) ("m" . month) ("y" . year))) + (let ((a1 '(("h" . hour) + ("d" . day) + ("w" . week) + ("m" . month) + ("y" . year))) + (shour (nth 2 (org-parse-time-string start))) dn dw sday cday n1 n2 n0 d m y y1 y2 date1 date2 nmonths nm ny m2) @@ -16177,6 +16182,11 @@ When SHOW-ALL is nil, only return the current occurrence of a time stamp." (error "Invalid change specifier: %s" change)) (if (eq dw 'week) (setq dw 'day dn (* 7 dn))) (cond + ((eq dw 'hour) + (let ((missing-hours (mod (- (* 24 (- cday sday)) shour) dn))) + (setq n1 (if (zerop missing-hours) cday + (- cday (1+ (floor (/ missing-hours 24))))) + n2 (+ cday (floor (/ (- dn missing-hours) 24)))))) ((eq dw 'day) (setq n1 (+ sday (* dn (floor (/ (- cday sday) dn)))) n2 (+ n1 dn))) -- 1.7.12.2 --=-=-=--