How to add to the vulpea-project-p DONE ToDo states but not archived #137
-
This is kind of a niche question. I am using d12frosted's agenda.el to dynamically add the filetag This brings up only a small problem for me. If a file has no TODOs, but a handful of DONE items, those DONE items won't appear in my Relevant code snippet:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey @DominikMendel You kind of answered your own question. Few things to note.
You can fetch it all together roughly like this: (defun vulpea-project-p ()
"Return non-nil if current buffer has any todo entry."
(org-element-map
(org-element-parse-buffer 'headline)
'headline
(lambda (h)
(and (org-element-property :todo-type h)
(not (seq-contains-p (org-element-property :tags h)
"ARCHIVE"))))
nil 'first-match)) |
Beta Was this translation helpful? Give feedback.
Hey @DominikMendel
You kind of answered your own question. Few things to note.
(org-element-property :todo-type h)
returns one of the 3 values:nil
(when there is no TODO cookie),todo
(when the task is not completed yet as perorg-todo-keywords
) anddone
(when the task is completed as perorg-todo-keywords
).:tags
property and check forARCHIVE
to be missing.You can fetch it all together roughly like this: