From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Tom Breton (Tehom)" Subject: Re: Feature request and patch - blocked TODO to say BLOCKED Date: Wed, 14 Jan 2009 21:34:25 -0500 (EST) Message-ID: <2542.66.30.178.137.1231986865.squirrel@mail.panix.com> References: <20090101170227.C707734803@mail2.panix.com> <1131.66.30.178.137.1230850437.squirrel@mail.panix.com> Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LNI3v-0000tc-63 for emacs-orgmode@gnu.org; Wed, 14 Jan 2009 21:34:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LNI3u-0000sX-02 for emacs-orgmode@gnu.org; Wed, 14 Jan 2009 21:34:26 -0500 Received: from [199.232.76.173] (port=49703 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNI3t-0000sF-Pa for emacs-orgmode@gnu.org; Wed, 14 Jan 2009 21:34:25 -0500 Received: from mail1.panix.com ([166.84.1.72]:65405) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LNI3t-0003Oe-Gc for emacs-orgmode@gnu.org; Wed, 14 Jan 2009 21:34:25 -0500 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: emacs-orgmode@gnu.org > 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 whitespac= e 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]