emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ross Patterson <me@rpatterson.net>
To: emacs-orgmode@gnu.org
Subject: org-agenda-list-stuck-projects and nested projects
Date: Mon, 07 Jul 2008 15:21:16 -0700	[thread overview]
Message-ID: <87wsjxnxnn.fsf@transitory.lefae.org> (raw)

One of the things I love about org-mode is that it's generally hierarchy
agnostic which is to say it doesn't care what level or depth entries are
with regards to the functionality org-mode provides with entries (TODOs,
Dates and times, tags, etc.).

Many of the projects I'd like to manage with org-mode are fairly large
and as such I'd like to make use of org-mode's heirarchical agnosticism
to factor my projects into nested projects arbitrary depth.  This is
supported very well by the rest of org-mode, just not the stuck projects
agenda view.

I find that view very valuable, but if I have a project with lots of
branches that can move in parallel and one of those branches is stuck
but another isn't stuck, then the stuck projects report doesn't reflect
this assuming that if one branch isn't stuck then the project isn't
stuck.  Since the project is very large, that means I have to inspect
the whole tree to figure out what might be stuck.  The only workaround
with the current implementation is that anytime I have a
project/sub-project/branch lower than LEVEL=2 that I need to be able to
review, then I have to break it out to a LEVEL=2 headline.  This creates
a negative feedback which will probably result in me not using the stuck
projects view and probably insufficiently reviewing my projects.

What I'd like is an agenda view like the stuck projects view but rather
than omitting any project that has any active TODO's all the way up the
hierarchy, it will only omit headlines that have active TODO's among its
immediate children.

If I start with a test.org file like so:

    * Testing
    ** Stuck Project at Level 2
    *** Sub-project at Level 3
    **** DONE bar
    *** Sub-project 2 at Level 3

And customize org-stuck-projects to remove the LEVEL=2 restriction like
so:

    (setq org-stuck-projects '("/-DONE" ("TODO") nil ""))

And finally customize the org-tags-match-list-sublevels to allow tags
matching to descend.

Then if I open test.org and do "C-c a < #" I get:

    List of stuck projects:
      test:       .Stuck Project at Level 2
      test:       ..Sub-project at Level 3
      test:       ..Sub-project 2 at Level 3

Then if I re-activate the bar heading by putting it in the TODO state:

    * Testing
    ** Stuck Project at Level 2
    *** Sub-project at Level 3
    **** TODO bar
    *** Sub-project 2 at Level 3

I get an empty list:

    List of stuck projects:

I'd like a list with the sub-heading that is still stuck:

    List of stuck projects:
      test:       .Stuck Project at Level 2
      test:       ..Sub-project 2 at Level 3

I tried modifying the org-agenda-list-stuck-projects function by
implementing an org-agenda-skip-function that only skips the heading
and not the whole subtree:

    (defun org-agenda-skip-entry-when-regexp-matches ()
      "Checks if the current entry contains match for `org-agenda-skip-regexp'.
    If yes, it returns the end position of this entry, causing agenda
    commands to skip this entry.  This is a function that can be put
    into `org-agenda-skip-function' for the duration of a command."
      (org-agenda-skip-if nil '(regexp org-agenda-skip-regexp)))

Then I replaced the org-agenda-skip-function set in
org-agenda-list-stuck-projects by replacing:

  (let* ((org-agenda-skip-function 'org-agenda-skip-subtree-when-regexp-matches)

with:

  (let* ((org-agenda-skip-function 'org-agenda-skip-entry-when-regexp-matches)

But that gets me:

    List of stuck projects:
      test:       .Stuck Project at Level 2
      test:       ..Sub-project at Level 3
      test:       ...TODO bar
      test:       ..Sub-project 2 at Level 3

I'm new to the internals of org-mode.  Can anyone help me figure out
what's wrong with my attempted solution here?

Ross

             reply	other threads:[~2008-07-07 22:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-07 22:21 Ross Patterson [this message]
2008-07-08 17:06 ` org-agenda-list-stuck-projects and nested projects Carsten Dominik
2008-07-08 17:47   ` Ross Patterson
2008-07-10 23:29     ` Ross Patterson
2008-07-14 19:17       ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wsjxnxnn.fsf@transitory.lefae.org \
    --to=me@rpatterson.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).