Skip to content
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

Argument handling in org-agenda-ql #5

Closed
natrys opened this issue Aug 21, 2018 · 4 comments
Closed

Argument handling in org-agenda-ql #5

natrys opened this issue Aug 21, 2018 · 4 comments

Comments

@natrys
Copy link
Contributor

natrys commented Aug 21, 2018

Hi, I probably shouldn't be using the issue tracker to bother you with something as small as this. But this example in the README doesn't work:

(org-ql-agenda "~/org-super-agenda/test/test.org"
  (and (or (date = today)
           (deadline <=)
           (scheduled <= today))
       (not (done))))

This particular example incidentally errors with a (void-variable todo-keyword) but right now I don't mean this.

The form: (org-ql-agenda "~/path/to/file" query) in general doesn't work unless a keyword argument is provided in the end (such as :sort nil). This seems to be a shortcoming in the pcase based argument matching in org-ql-agenda macro. I had to add another case handling condition to make it work:

    (`(,arg-files ,arg-pred)
     (setq files arg-files
           query arg-pred))

But you may have some other cleaner means in mind.

@alphapapa
Copy link
Owner

Thanks, I made some changes to that code recently but didn't test all the combinations that are possible. (I wish there were a more flexible way to handle arguments, but I haven't come up with anything suitable yet. If you are interested in this, take a look at magnars/dash.el#268.)

This particular example incidentally errors with a (void-variable todo-keyword) but right now I don't mean this.

Not sure why that would happen, as I just tested the example and it works for me. Please let me know if it still happens, as it's probably a bug that needs fixing.

alphapapa added a commit that referenced this issue Aug 21, 2018
@alphapapa
Copy link
Owner

Actually, I think I found and fixed that bug. Thanks for reporting it! My config made it unnoticeable for me.

@natrys
Copy link
Contributor Author

natrys commented Aug 21, 2018

Thanks for the quick fix. Next up, when I run the example again, it now shows: (void-variable repeat) when it hits this line.

I don't really understand what's going on here, perhaps you wanted to mean repeat-day-number? Also, here it seems nothing happens when this condition is satisfied. But then prefix becomes t, is that desired?

alphapapa added a commit that referenced this issue Aug 22, 2018
Also unnecessary since we use --format-relative-date.  If we ever want
to exactly emulate the Agenda, this can be replaced.

See #5 (comment).
@alphapapa
Copy link
Owner

Sorry, that was leftover code that wasn't being exercised in my config. I removed it, so it should be fixed. Thanks.

US-Thakur pushed a commit to US-Thakur/merge_testing that referenced this issue Mar 14, 2022
Also unnecessary since we use --format-relative-date.  If we ever want
to exactly emulate the Agenda, this can be replaced.

See alphapapa/org-ql#5 (comment).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants