From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: [PATCH] New org-depend trigger for finding next highest priority/effort item Date: Tue, 26 Jul 2011 13:48:30 +0200 Message-ID: <874o29tg8h.fsf@gnu.org> References: <87k4b7fqu3.wl%max@openchat.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:54583) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qlg7O-0004kc-IN for emacs-orgmode@gnu.org; Tue, 26 Jul 2011 07:48:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qlg7N-0004WQ-32 for emacs-orgmode@gnu.org; Tue, 26 Jul 2011 07:48:10 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:49866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qlg7M-0004WM-9U for emacs-orgmode@gnu.org; Tue, 26 Jul 2011 07:48:08 -0400 Received: by wyg36 with SMTP id 36so138182wyg.0 for ; Tue, 26 Jul 2011 04:48:07 -0700 (PDT) In-Reply-To: <87k4b7fqu3.wl%max@openchat.com> (Max Mikhanosha's message of "Sun, 24 Jul 2011 14:58:44 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Max Mikhanosha Cc: emacs-orgmode@gnu.org Hi Max, Max Mikhanosha writes: > org-depend TRIGGER chain-siblings(NEXT) property is hardly usable for > me, because it requires too much effort to keep items nicely sorted. > > For example if next headline is already in DONE state, chain-siblings > would still change it. I prefer to sort my items by setting their > priorities and/or effort estimate, leaving DONE items in place for > some time. > > Attached patch implements new TRIGGER chain-find-next(NEXT[,options]) > trigger, which allows to flexibly select which of the siblings will be > changed to NEXT. Thanks for this! > Example: chain-find-next(NEXT,from-current,priority-up,todo-only) > > >>From 10ac42d25793eedc595641555186321219818cec Mon Sep 17 00:00:00 2001 > From: Max Mikhanosha > Date: Sun, 24 Jul 2011 14:44:44 -0400 > Subject: [PATCH 11/11] Add chain-find-next trigger option. > > --- > contrib/lisp/org-depend.el | 142 +++++++++++++++++++++++++++++++++++++++++++- > 1 files changed, 140 insertions(+), 2 deletions(-) > > diff --git a/contrib/lisp/org-depend.el b/contrib/lisp/org-depend.el > index 089a6a0..aa8e728 100644 > --- a/contrib/lisp/org-depend.el > +++ b/contrib/lisp/org-depend.el > @@ -55,7 +55,43 @@ > ;; - The sibling also gets the same TRIGGER property > ;; "chain-siblings-scheduled", so the chain can continue. > ;; > -;; 3) If the TRIGGER property contains any other words like > +;; 3) If the TRIGGER property contains the string > +;; "chain-find-next(KEYWORD[,OPTIONS])", then switching that entry > +;; to DONE do the following: > +;; - All siblings are of the entry are collected into a temporary > +;; list and then filtered and sorted according to OPTIONS > +;; - The first sibling on the list is changed into KEYWORD state > +;; - The sibling also gets the same TRIGGER property > +;; "chain-siblings-scheduled", so the chain can continue. ^^^^^^^^^^^^^^^^^^^^^^^^ This should rather be "chain-find-next" here, right? > +;; OPTIONS should be a comma separated string without spaces, and > +;; can contain following options: > +;; > +;; - from-top the candidate list is all of the siblings in > +;; the current subtree > +;; > +;; - from-bottom candidate list are all siblings from bottom up > +;; > +;; - from-current candidate list are all siblings from current item > +;; until end of subtree, then wrapped around from > +;; first sibling > +;; > +;; - no-wrap candidate list are siblings from current one down I'm not sure to understand the difference between "from-top" and "from-current", and between "from-top" and "no-wrap". Can you give an example? > +;; > +;; - include-done include siblings with TODO in `org-done-keywords', > +;; they are excluded by default The phrasing is a bit confusing to me -- perhaps removing "they are excluded by default" is enough. > +;; - todo-only Only consider siblings that have TODO only, by default > +;; siblings without TODO keyword are considered too I suggest this: "Only consider siblings that have a TODO keyword." I suppose "todo-only" and "include-done" are compatible, right? What about using exclusive options like "todo-only" and "todo-and-done-only"? So that you would need to use only one. > +;; - priority-up sort by highest priority > +;; - priority-down sort by lowest priority > +;; - effort-up sort by highest effort > +;; - effort-down sort by lowest effort > +;; > +;; Default OPTIONS are from-top > +;; > +;; > +;; 4) If the TRIGGER property contains any other words like > ;; XYZ(KEYWORD), these are treated as entry id's with keywords. That > ;; means Org-mode will search for an entry with the ID property XYZ > ;; and switch that entry to KEYWORD as well. > @@ -121,6 +157,7 @@ > ;; > > (require 'org) > +(require 'cl) This (eval-when-compile (require 'cl)) -- Emacs has a policy of preventing (require 'cl) only... Thanks for further feedback on this! If you can provide a small Org file where I can test the new functionalities that will help a lot. Best, -- Bastien