-
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
Proposal to include time ranges in :scheduled and :deadline selectors #169
Comments
Did you see this sentence in the documentation under
|
I did, and I didn't think a static date would work for a long running session. But your prompting did make me take a second look and those values are re-evaluated every time the agenda is rebuilt, so dynamic values are possible. So there's no need for expanding the selectors after all. (Good thing I asked first, that saved several hours worth of effort) With that out of the way I wonder what would be the idiomatic way to pass a date to something like "1 week in the future"? So far I have come up with |
Yes, I think this is where the API may be improved. It should probably be similar to org-ql's API, in that the DATE argument should also accept an integer value, which would be interpreted as a number of days relative to the current date. |
I've scoured the documentation, but I could not determine if the date I specify would be re-evaluated in a long running session. I know @Alexander-Miller mentions that they are re-evaluated when the agenda is rebuilt, but does that mean both (:name "Due soon" :deadline (before ,(org-read-date nil nil "+14d"))) I'd be more than happy to submit a PR to clarify the documentation for |
@pkazmier The issue you're asking about appears to be a matter of your setting a variable's value and of splicing into a backquoted list (although you didn't show a backquote in your code). Maybe this demonstration will clarify: (setq org-super-agenda-groups `((:name "Due soon" :deadline (before ,(org-read-date nil nil "+14d")))))
;;=> ((:name "Due soon" :deadline (before "2020-12-20")))
org-super-agenda-groups
;;=> ((:name "Due soon" :deadline (before "2020-12-20"))) As you can see, the value of the variable Although this kind of question comes up not infrequently, I'm reluctant to attempt to teach Lisp (especially matters of variables, values, and backquoting/splicing) in this package's documentation. It's properly out of the package's scope. Some basic Elisp knowledge is necessary in order to construct lists for |
Sorry, I should have been more clear. I know how to use backquote and splicing. I just didn't paste the full example with the initial backquote. I was really asking what is the proper way to group events in categories such as "Due in a week" vs just any task with a deadline in the |
I was thinking about this a bit more, with a very small change, I believe dates in the form of "+12d" or "+2m" could be supported in the Before (Line 453 and 490):
After:
I'm not near my computer, so I have not tested, but will try tomorrow. Would you be willing to accept a PR if this works? I think this would enhance the usability of the two selectors immensely. Thoughts? |
Seems like a good idea, probably one I should have thought of myself. |
I tried this solution but couldn't make it work: |
Hi, I get the same thing (wrong type argument: stringp, ...) even when I try the version mentioned in this comment. #169 (comment) If you managed to solve it I would love to hear about how. |
I have 2 use-cases that I think cannot be accurately modeled with the currently available selectors:
Currently it is only possible to match either a specific date, or anything with a future deadline/scheduled property. For me that means my Soon group will even include habits that are scheduled for the middle of next year.
So my proposal is to expand these selectors to be able to include items scheduled/deadlined no further away than x days in the future.
I built a small MVP yesterday, the implementation is simple, as usual most effort will need to go into documentation and testing.
Specifically there's 2 things I would like to get your opinion on before working on a proper PR:
(:name "Soon" :scheduled (closer-than 7))
, but it is a bit awkward with adding the currently useless "days" so it reads(closer-than 7 days)
.The text was updated successfully, but these errors were encountered: