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
Sort entries by due date when using org-ql-block #79
Comments
|
Thanks for the kind words. I'm glad it's helpful to you. Actually, there is no way to do that at the moment. That's an oversight on my part. I'll need to add additional arguments to the block function so |
|
Seconding the request |
No apologies needed! I will try to take a look at the code too |
Or maybe you can support the feature by adding a variable for a sorting strategy, like |
|
@akirak That's a good point. What do the rest of you think? |
I feel that it would be better to stick to built-in org-mode functions as much as possible. Otherwise, you may end up reimplementing the whole org-agenda.el from scratch. I believe that only the most performance-critical functions from org-agenda need to be reimplemented. |
|
@yantar92 The question here is only how to present the sorting argument in the block definition, not the implementation. In fact, org-ql is essentially a reimplementation of the agenda--that's the point, because org-agenda.el is very difficult to understand and modify, and nearly impossible to extend. |
|
I am ambivalent to either solution. But of course whichever method is easier to leverage upon the built in org mode functionality should be preferred, to make implementation easier. |
|
@jakejx Sorting is already implemented in org-ql. org-agenda sorting functions are not used. (If you're curious as to why, look at the code for the function The question here is whether to pass the sort argument like this, which is consistent with (setq org-agenda-custom-commands
'(("ces" "Custom: Agenda and Emacs SOMEDAY [#A] items"
((org-ql-block ('(and (todo "SOMEDAY")
(tags "Emacs")
(priority "A"))
:sort '(date priority todo)))
(agenda)))))or like this, which is more like org-agenda block settings: (setq org-agenda-custom-commands
'(("ces" "Custom: Agenda and Emacs SOMEDAY [#A] items"
((org-ql-block '(and (todo "SOMEDAY")
(tags "Emacs")
(priority "A"))
((org-ql-block-sort '(date priority todo))))
(agenda)))))I'm generally in favor of the first example, because it's consistent with |
(org-ql-block ('(and (todo "SOMEDAY")
(tags "Emacs")
(priority "A"))
:sort '(date priority todo)))This looks better than I expected. Actually, I now even prefer it over the other, because it allows easy migration to/from normal org-ql forms and requires less memorization of variable names.
Thanks, I'll take a look at it.
org-ql started out as a library for org-agenda-ng, which was an experiment by alphapapa to improve upon the API of org-agenda. org-agenda-ng was merged into org-ql. As he develops org-ql, it is becoming a practical alternative to org-agenda. |
|
In a view on Also, replacing |
|
I looked into making sorting in Org Agenda performs sorting based on a Anyway, I found the way to make However, I realized that changing the way So I've pushed this WIP branch: https://github.com/alphapapa/org-ql/tree/wip/issue-79 for 0.5. |
|
this could be another bug, but for me it serves as a workaround:
i have a dummy block before the maybe this is related to #121, in the sense that there is some cleanup missing when initializing the agenda-buffer for org-ql. anyways, now i can sort the way i like :-) |
|
@bitclick I'm afraid that's not the case. As I explained in #79 (comment), org-ql blocks are not compatible with org-agenda sorting. You can test this for yourself as follows: In a clean Emacs instance:
(setq org-agenda-custom-commands
'(("A" "Today"
((todo "nothing here"
((org-agenda-sorting-strategy '(timestamp-down))))
(org-ql-block '(ts)
((org-ql-block-header "TEST")))))))
|
|
New to org-ql and org-super-agenda. I am trying to sort items by priority within a group defined by org-ql-block in org-agenda-custom-commands. Just saw this is still open. Does it mean I can not sort items within group of org-super-agenda with org-ql? I saw the doc of org-super-agenda said:
But I also saw a Reddit thread said:
So I am very confused: Is it possible to sort within a group of org-super-agenda (using |
Thanks for this work. I've been trying it out and found it tricky to properly declare org-agenda-custom-command so I'm pasting what I got working for others who make wander by. Pardon the spread-out syntax -- I had to do that to figure out what I kept doing wrong -- which was an incorrect combination of quoting. ("c" "<c>aptured things" ;; [1] key [2] description
org-ql-block ;; [3] function that select items
'( ;; [4] match/query expression
(property "CAPTURED") ;; arg1: org-query expression
:sort (priority date) ;; keyword arg
:header "xyzzy" ;; keyword arg
)
( ;; [5] list of extra settings
)
() ;; [6] list of files to export to
) ;; end of agenda entry definition |
|
Since this involves changing the format, what should probably be done is:
|
|
Retargeting this for 0.7. 0.6 has been delayed for too long. |
Hello, thank you for this wonderful package, it makes my custom agendas useable again!
I am in the process of porting some of my custom agenda commands I was wondering whether it was possible to sort my results based on the deadline. I tried using the conventional way of setting
org-agenda-sorting-strategy, but I don't think it works. Here is what my agenda command looks likeIs setting the sorting strategy like this supported? Thanks!
The text was updated successfully, but these errors were encountered: