From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Feature request and patch - blocked TODO to say BLOCKED Date: Sat, 17 Jan 2009 09:01:35 +0100 Message-ID: <769CB99E-C5F4-4341-A235-E89153657472@uva.nl> References: <20090101170227.C707734803@mail2.panix.com> <1131.66.30.178.137.1230850437.squirrel@mail.panix.com> <2542.66.30.178.137.1231986865.squirrel@mail.panix.com> Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LO67x-0006RB-Er for emacs-orgmode@gnu.org; Sat, 17 Jan 2009 03:01:57 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LO67w-0006Ql-QI for emacs-orgmode@gnu.org; Sat, 17 Jan 2009 03:01:56 -0500 Received: from [199.232.76.173] (port=32779 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LO67w-0006Qh-Ib for emacs-orgmode@gnu.org; Sat, 17 Jan 2009 03:01:56 -0500 Received: from mx20.gnu.org ([199.232.41.8]:51806) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LO67v-0005v6-Rc for emacs-orgmode@gnu.org; Sat, 17 Jan 2009 03:01:56 -0500 Received: from ey-out-1920.google.com ([74.125.78.149]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LO67v-000679-0K for emacs-orgmode@gnu.org; Sat, 17 Jan 2009 03:01:55 -0500 Received: by ey-out-1920.google.com with SMTP id 4so219062eyg.24 for ; Sat, 17 Jan 2009 00:01:54 -0800 (PST) In-Reply-To: <2542.66.30.178.137.1231986865.squirrel@mail.panix.com> 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: "Tom Breton (Tehom)" Cc: emacs-orgmode@gnu.org Hi Tom, thanks for the patch, I have applied it, with one change: The variable is now called `org-depend-tag-blocked'. Thanks! - Carsten On Jan 15, 2009, at 3:34 AM, Tom Breton (Tehom) wrote: >> 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] > >