-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Support for recurring events #159
Comments
https://github.com/unhammer/org-upcoming-modeline/blob/27fb74f9e7480c40b95af2170f5d427fd21e0953/org-upcoming-modeline.el#L286-L308
Also, is there a ts-to-time function? Didn't find one. (And would the actual parsing of recurring strings belongs in ts, not org-ql? But then ts would have to have some representation of recurring events.) |
Here's my function (using TS) to update a repeated date until it is current. Maybe seeing my shoddy work will motivate someone to do it better. |
It would be useful, yes. In order to do it, you'd need a function to take an Org timestamp that repeats and return the next timestamp repetition after a certain date. Then you could call that function in the Of course, that wouldn't be appropriate for the default @unhammer It looks like you've already worked that out! :)
Yes, I'm glad to see that it's being useful already. :)
I don't know what you mean by "time". Maybe you mean, e.g. Edit: Oh, I think you mean
If there were a universal way to represent them, yes, but since this is specific to Org, I think it belongs in @legalnonsense I like that. The suggestion I'd make is to calculate the offset and adjust it once rather than using a loop to adjust it repeatedly. |
> Also, is there a ts-to-time function? Didn't find one.
I don't know what you mean by "time". Maybe you mean, e.g. `(ts-unix
(ts-now))` for a Unix timestamp?
Oh, I meant that strange format used by `(current-time)`. I'm currently
doing
https://github.com/unhammer/org-upcoming-modeline/blob/main/org-upcoming-modeline.el#L237-L247 which
isn't too bad, but perhaps I'm not the only ts user who has a need of
converting back to `(HIGH LOW)`
|
something like |
I wish GitHub would send emails when a comment is modified. :) I added this to my message: "Edit: Oh, I think you mean ts-internal, which does (apply #'encode-time (decode-time (ts-unix struct))). Apparently I omitted that from the documentation. I'll see about adding it. Thanks." |
Hi! I'd also be interested in such a feature. I'd be happy to help putting some code together. The function proposed by @legalnonsense seems to go in the right direction. Where can we go from there ?
Is there a way to make this work in org-ql-select and org-ql-query directly ? One problem I see if we do this as an action on the query results is that it would be limited to the time range of the query. For example if i only query headlines for this week but there is a repeating headline the week before I wouldn't get it, right? I seems the interpretation of repetition should appear way ahead. Any hint on where to start looking in the source? |
Implementing this may be non-trivial. By default, Of course, something like this would be necessary to reimplement all of Org Agenda's features, so it's something I would like to do. But I'm not sure of the best way to do so. It may be necessary to implement this as a higher-level API on top of For example, when building an agenda view for a week, it could make 7 "passes" through the results returned by |
Having said that, it may still be necessary to make some changes to the timestamp-based predicates to account for repeating intervals. But they should be carefully considered. For example, if a timestamp has a repeating interval, would it be useful or desired to consider it to be open-ended, i.e. to repeat infinitely? That could cause it to match more queries than expected. As well, calculating such repetitions could adversely affect performance, so benchmarking would be needed. |
I'm using org-ql indirectly through org-upcoming-modeline, a very useful package that shows the next event in the agenda in the mode line as a reminder.
One limitation is that org-upcoming-modeline doesn't show recurring events. Example:
For this event, I get a reminder for the first instance but none for the repetitions.
Is there a way to include the repetitions in the org-ql query results as well? I think this would be a tremendously useful extension.
The text was updated successfully, but these errors were encountered: