How can I retrieve, over an elisp list of files list-of-files, a view of all org-mode headers that (i) were CLOSED in between start and end such that (ii) these headers have a property P defined (that isn't nil)?

  • What do you mean by "a view of all org-mode headers". Do you want a list of headline titles matching these conditions? Please explain.
    – jagrg
    Commented May 14, 2019 at 14:35
  • I meant an agenda view. Should have been more clear.
    – George
    Commented May 14, 2019 at 21:06

1 Answer 1


Again you need a function to determine whether the closed timestamp is within the specified range. Now add the following to your agenda command to skip all entries not matching those conditions:

 (lambda ()
   (let ((ts (assoc-default "CLOSED" (org-entry-properties))))
     (unless (and (org-entry-get nil "P")
                  (timestamp-within-range-p "[2019-01-01]" "[2019-05-15]" ts))
       (save-excursion (outline-next-heading) (point))))))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.