org-ql icon indicating copy to clipboard operation
org-ql copied to clipboard

Does `:sort '(priority)` support numerical values?

Open nanjigen opened this issue 3 years ago • 1 comments

I'm attempting to sort an org-ql-search by priority using numerical values instead of the default alpha system:

(org-ql-search (org-agenda-files)
   '(todo "TODO")
  :sort '(priority)
  :title "Todo List")

And at the top of the file I have #+PRIORITIES: 1 60 30

However the items are not sorted at all, and instead are listed in the order they appear in the buffer. Changing to alpha priorities seems to work however.

nanjigen avatar Mar 26 '22 00:03 nanjigen

You can see the implementation here: https://github.com/alphapapa/org-ql/blob/46f523d94a376b168176c75bbd0e3e0d00e61170/org-ql.el#L2218 The org-element :priority property is used, which comes from calling org-element-headline-parser. Maybe that function is not taking your manual priority values into account?

alphapapa avatar Mar 26 '22 04:03 alphapapa

This is tracked in #140.

alphapapa avatar Dec 09 '22 07:12 alphapapa