emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Tom Breton (Tehom)" <tehom@panix.com>
To: Carsten Dominik <dominik@science.uva.nl>
Cc: emacs-orgmode@gnu.org
Subject: Re: Feature request and patch - blocked TODO to say BLOCKED
Date: Wed, 14 Jan 2009 21:34:25 -0500 (EST)	[thread overview]
Message-ID: <2542.66.30.178.137.1231986865.squirrel@mail.panix.com> (raw)
In-Reply-To: <DDD4C54F-B799-422F-AD83-45F142B28EFC@uva.nl>

> Hi Tom,
>
> I am hesitant to apply this relatively complex patch which
> I have not had the time to study closely enough.
> I am wondering:  Instead of setting a TODO keyword,
> would it not be simpler and equally effective to set a
> special tag when an entry is blocked?

That is a much better solution.  I have coded that and tested it against
an example file, and it works.

I've attached a patch.  One note: I used diff flag -b to ignore whitespace
because most of the change is that the big `catch' statement isn't
directly returned but assigned to proceed-p.  So most of it got indented
further but no change other than whitespace.  I can diff it without -b if
you prefer.

> You could use a bright font to mark this tag, in order to
> make it obvious.  And you could use a custom query to look
> for blocked items, to see what can be done about them....

Tom Breton (Tehom)

[example-file.org]

* Header
** TODO Blocking item
** Item that gets blocked
    :PROPERTIES:
   :BLOCKER:  previous-sibling
   :END:
[end]

[begin patch]
*** old-org-depend.el	2009-01-04 03:01:50.000000000 -0500
--- ord-depend.el	2009-01-14 21:15:47.000000000 -0500
***************
*** 112,117 ****
--- 112,121 ----
  ;;

  (require 'org)
+ (defcustom org-tag-blocked-depends t
+   "Whether to indicate blocked TODO items by a special tag."
+   :group 'org
+   :type 'bool)

  (defun org-depend-trigger-todo (change-plist)
    "Trigger new TODO entries after the current is switched to DONE.
***************
*** 191,197 ****
  	 (from (plist-get change-plist :from))
  	 (to (plist-get change-plist :to))
  	 (org-log-done nil) ; IMPROTANT!: no logging during automatic trigger
! 	 blocker blockers bl p1)
      (catch 'return
        (unless (eq type 'todo-state-change)
  	;; We are not handling this kind of change
--- 195,202 ----
  	 (from (plist-get change-plist :from))
  	 (to (plist-get change-plist :to))
  	 (org-log-done nil) ; IMPROTANT!: no logging during automatic trigger
! 	 blocker blockers bl p1
! 	   (proceed-p
  	      (catch 'return
  		 (unless (eq type 'todo-state-change)
  		    ;; We are not handling this kind of change
***************
*** 234,239 ****
--- 239,251 ----
  				(throw 'return nil))))))
  		 t     ; return t to indicate that we are not blocking
  		 )))
+      (when org-tag-blocked-depends
+ 	(org-toggle-tag "blocked"
+ 	   (if proceed-p 'off 'on)))
+
+      proceed-p))
+
+

  (add-hook 'org-trigger-hook 'org-depend-trigger-todo)
  (add-hook 'org-blocker-hook 'org-depend-block-todo)

[end patch]

  reply	other threads:[~2009-01-15  2:34 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090101170227.C707734803@mail2.panix.com>
2009-01-01 22:53 ` Tom Breton (Tehom)
2009-01-09  8:16   ` Carsten Dominik
2009-01-15  2:34     ` Tom Breton (Tehom) [this message]
2009-01-17  8:01       ` Carsten Dominik
2009-01-19  3:33     ` Advice sought on managing decision alternatives Tom Breton (Tehom)
2009-01-22 11:15       ` Carsten Dominik
2009-01-31  4:21         ` Tom Breton (Tehom)
2009-01-31  5:41           ` Carsten Dominik
2009-01-31 18:36             ` Tom Breton (Tehom)
2009-02-01 15:54               ` James TD Smith
2009-02-06 13:08           ` Carsten Dominik
2009-02-06 16:16             ` William Henney
2009-02-06 20:07             ` Tom Breton (Tehom)
2009-02-07  0:18               ` Carsten Dominik
2009-02-07 20:46                 ` Tom Breton (Tehom)
2009-02-08 13:06                   ` Carsten Dominik
2009-02-08 20:25                     ` Tom Breton (Tehom)
2009-02-09  6:42                       ` Carsten Dominik
2009-02-10  3:14                         ` Docs submitted (Was Re: Advice sought on managing decision alternatives.) Tom Breton (Tehom)
2009-02-10  7:55                           ` Carsten Dominik
2009-02-24  0:51                             ` org-choose bugfix Tom Breton (Tehom)
2009-02-24  3:05                               ` Manish
2009-04-07  0:13                                 ` Tom Breton (Tehom)
2009-04-08 13:13                                   ` Carsten Dominik
2009-02-24  5:51                               ` Carsten Dominik
2009-02-10  8:46                           ` Docs submitted (Was Re: Advice sought on managing decision alternatives.) Manish
2009-02-10  9:12                             ` Carsten Dominik
2009-02-10 10:26                               ` Manish
2009-02-10 22:48                                 ` Tom Breton (Tehom)
2009-02-12 12:50                                   ` Manish
2009-02-12 20:13                                     ` Tom Breton (Tehom)
2009-02-13  4:23                                       ` Manish
2009-02-12 20:55                                     ` Patch " Tom Breton (Tehom)
2009-02-13  4:38                                       ` Manish
2009-02-11  1:08                                 ` Tom Breton (Tehom)
2009-02-11 10:34                                   ` Carsten Dominik
2009-02-11 21:41                                     ` Tom Breton (Tehom)
2009-02-11 23:38                                       ` Nick Dokos
2009-02-12  4:17                                         ` Tom Breton (Tehom)
2009-02-11 23:44                                       ` Carsten Dominik
2009-02-12  4:27                                         ` Tom Breton (Tehom)
2009-02-12 15:49                                           ` Nick Dokos
2009-02-12 20:32                                             ` Tom Breton (Tehom)
2009-02-12 21:25                                               ` Nick Dokos
2009-02-11 12:29                                   ` Carsten Dominik
2009-02-11 14:58                                     ` Docs submitted Bernt Hansen
2009-02-11 17:33                                       ` Samuel Wales
2009-02-11 15:38                                     ` Docs submitted (Was Re: Advice sought on managing decision alternatives.) Daniel Clemente
2009-02-11 15:41                                       ` Carsten Dominik
2009-02-11 20:02                                     ` Tom Breton (Tehom)
2009-02-11 23:45                                       ` Carsten Dominik
2009-02-11  1:45                                 ` Slight fix to update-org.sh Tom Breton (Tehom)
2009-02-10 23:19                               ` Docs submitted (Was Re: Advice sought on managing decision alternatives.) Tom Breton (Tehom)
2009-02-11 10:34                                 ` Carsten Dominik
2009-02-10 22:45                             ` Tom Breton (Tehom)

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=2542.66.30.178.137.1231986865.squirrel@mail.panix.com \
    --to=tehom@panix.com \
    --cc=dominik@science.uva.nl \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: Feature request and patch - blocked TODO to say BLOCKED' \
    /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

Code repositories for project(s) associated with this 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).