I'm trying to build custom agenda block which would sort completed tasks by CLOSED property. org-agenda-sorting-strategy only supports ordering by SCHEDULED and DEADLINE properties, so I guess only way to implement this is to use custom sorting function with org-agenda-cmp-user-defined. Any help would be greatly appreciated.
;; custom sorting for closed items (does not work)
(defun my/org-custom-cmp (a b)
(org-cmp-ts a b "closed")
)
(setq org-agenda-cmp-user-defined 'my/org-custom-cmp)
(setq org-agenda-custom-commands
'(("z" "Tasks Overview"
((tags "+TODO=\"DONE\"+CLOSED>\"<-3d>\"" ((org-agenda-cmp-user-defined 'my/org-custom-cmp)
(org-agenda-sorting-strategy '(user-defined-up))
(org-agenda-max-entries 15)
(org-agenda-overriding-header "Recently Completed Tasks")))
))
;; ...
M-x eval-expression RET (message "%s" (text-properties-at (point)) RETand see if there are any properties that indicate the closed date, and then either update your question or post a comment with the results. I added text properties for many items in a custom version of org-mode, and I sent in a feature request to the org-mode team a couple of years ago to increase the sorting abilities. The org-team responding by stating that fixes/enhancements were in the works. What version oforg-modeare you using?org-modeversion8.3.5, I've tried usingtext-properties-at(andM-x describe-text-properties), but couldn't find anything related to closed timestamp there.