From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Memnon Anon <gegendosenfleisch@googlemail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Problem with hourly repeater
Date: Wed, 10 Oct 2012 16:14:38 +0200 [thread overview]
Message-ID: <871uh65s8h.fsf@gmail.com> (raw)
In-Reply-To: <874nm5avug.fsf@mean.albasani.net> (Memnon Anon's message of "Mon, 8 Oct 2012 14:37:36 +0000 (UTC)")
[-- Attachment #1: Type: text/plain, Size: 337 bytes --]
Hello,
Memnon Anon <gegendosenfleisch@googlemail.com> 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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix hour repeaters --]
[-- Type: text/x-patch, Size: 1575 bytes --]
From 3576891ba04992328576c1ea84a8958e4c0fa16c Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <n.goaziou@gmail.com>
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
next prev parent reply other threads:[~2012-10-10 14:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-08 14:37 Problem with hourly repeater Memnon Anon
2012-10-10 14:14 ` Nicolas Goaziou [this message]
2012-10-19 10:19 ` Memnon Anon
2012-10-10 14:44 ` Martin Pohlack
2012-10-10 15:00 ` Nicolas Goaziou
2012-10-10 15:04 ` Memnon Anon
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=871uh65s8h.fsf@gmail.com \
--to=n.goaziou@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=gegendosenfleisch@googlemail.com \
/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).