emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Problem with defining stuck projects
@ 2022-07-07 16:32 Bob Heffernan
  2022-07-08  4:51 ` Ihor Radchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Bob Heffernan @ 2022-07-07 16:32 UTC (permalink / raw)
  To: emacs-orgmode

Dear all,

I am having trouble setting org-stuck-projects in a way that works for me.

My org-files are organised something like this...
* Non-project header
  - blah, blah
  ** Foo
* TODO Project 1
  ** TODO Do this
     CLOSED: [2022-07-06 Wed 17:10] SCHEDULED: <2022-07-06 Wed>
  ** TODO Do these
  *** TODO First thing
      CLOSED: [2022-07-06 Wed 17:20] SCHEDULED: <2022-07-06 Wed>
  *** TODO Second thing
* TODO Project 2
  ** TODO Something
     SCHEDULED: <2022-07-07 Thu>

I want the following:
  1. A project is a level 1 header marked as TODO
  2. A project is not stuck if it has any sub-header that is scheduled but not closed.

So, in the example above Project 1 counts as stuck, but Project 2 does not.

What I've got so far is this:
(setq org-stuck-projects
          '("+LEVEL=1/TODO-DONE" nil nil "SCHEDULED:")

But this will clearly mark both projects 1 and 2 as stuck.
I need some way of specifying the "but not closed" part, but am at a loss as to how I can do this.

Any help is appreciated.
Regards,
Bob Heffernan


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problem with defining stuck projects
  2022-07-07 16:32 Problem with defining stuck projects Bob Heffernan
@ 2022-07-08  4:51 ` Ihor Radchenko
  2022-07-08 14:37   ` Bob Heffernan
  0 siblings, 1 reply; 3+ messages in thread
From: Ihor Radchenko @ 2022-07-08  4:51 UTC (permalink / raw)
  To: Bob Heffernan; +Cc: emacs-orgmode

Bob Heffernan <bob.heffernan@gmail.com> writes:

> I want the following:
>   1. A project is a level 1 header marked as TODO
>   2. A project is not stuck if it has any sub-header that is scheduled but not closed.
>
> So, in the example above Project 1 counts as stuck, but Project 2 does not.
>
> What I've got so far is this:
> (setq org-stuck-projects
>           '("+LEVEL=1/TODO-DONE" nil nil "SCHEDULED:")
>
> But this will clearly mark both projects 1 and 2 as stuck.
> I need some way of specifying the "but not closed" part, but am at a loss as to how I can do this.

If you have org-log-done set to 'time, your completed (closed) tasks
will contain CLOSED: ... in their planning line:

* DONE headline
CLOSED: [timestamp] SCHEDULED: [timestamp]

So, you can try the following regexp instead of "SCHEDULED:":

"^[ \t]*\\(SCHEDULED:\\|DEADLINE:\\)"

Best,
Ihor


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problem with defining stuck projects
  2022-07-08  4:51 ` Ihor Radchenko
@ 2022-07-08 14:37   ` Bob Heffernan
  0 siblings, 0 replies; 3+ messages in thread
From: Bob Heffernan @ 2022-07-08 14:37 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

On 22-07-08 12:51, Ihor Radchenko wrote:
> "^[ \t]*\\(SCHEDULED:\\|DEADLINE:\\)"

Ihor,
This seems to work.  Thank you.

Regards,
Bob


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-08 14:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-07 16:32 Problem with defining stuck projects Bob Heffernan
2022-07-08  4:51 ` Ihor Radchenko
2022-07-08 14:37   ` Bob Heffernan

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).