2

Imaginee I set a deadline for Project A and the schedule date for task A1 and A2, now the project is cancelled (with CANCELLED todo keyword), which makes the scheduled date for A1 and A2 invalidated.

Note, I didn't remove the SCHEDULED: keywords in the sequential nodes. These information is useful if the project is activated again somehow.

I wonder what's the best way to ignore these dates (deadline and schedule) in the org-agenda?

The org buffer looks like this:

* CANCELLED Project A 
  DEADLINE: <2015-12-22 Tue>
** A1 
   SCHEDULED: <2015-12-25 Fri>
** A2 
   SCHEDULED: <2016-01-03 Sun>

This is the org-agenda buffer I have.

enter image description here

5

Children don't inherit the "done" state of their parents. They do inherit tags, so you can set a special tag on the parent and tell the agenda to ignore anything with that tag. In fact, org-mode provides such a tag out of the box: ARCHIVE. You can (un)set it with org-toggle-archive-tag (C-c C-x a); see the internal archiving section of the manual. Reviving the project is as simple as removing the archive tag (using C-c C-x a a second time).

If you want all CANCELLED projects to automatically be archived, you can have the tag automatically applied when the todo state changes:

(setq org-todo-state-tags-triggers
  '(("CANCELLED" ("ARCHIVE" . t)))) 
  • that's an excellent solution. thanks. – yi.tang.uni Jan 11 '16 at 18:18
0

You can set the variables org-agenda-skip-scheduled-if-done and org-agenda-skip-deadline-if-done to t if you want your "done" TODO items to get skipped in the agenda.

Here's a link to the org manual node on deadlines and scheduling for more information..

So, for example:

(setq org-agenda-skip-scheduled-if-done t
      org-agenda-skip-deadline-if-done  t
      org-todo-keywords '((sequence "TODO" "|" "DONE" "CANCELLED")))
  • Thanks for your reply. The tricky bit here is I didn't remove the SCHEDULED: keywords in the sequential nodes. These information is useful if the project is activated again somehow. – yi.tang.uni Dec 22 '15 at 1:01
  • @yi.tang.uni: that was a reading comprehension fail on my part, sorry. – Dan Dec 22 '15 at 1:03
0

you can also put COMMENT keyword first so subtasks will not be scanned for Scheduled tag.

i refile all DONE tasks to "COMMENT Done" and these DONE Task are not shown in Agenda

  • COMMENT Done
  • ** DONE asdfg

Good point is that you can have bird eye view about which projects are commented, you dont have to look for ARCHIVE Tagged projects

Sorry for such a poorly formatted answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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