From: Max Mikhanosha <max@openchat.com>
To: Bastien <bzg@altern.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] New org-depend trigger for finding next highest priority/effort item
Date: Tue, 26 Jul 2011 17:56:39 -0400 [thread overview]
Message-ID: <878vrk66zs.wl%max@openchat.com> (raw)
In-Reply-To: <874o29tg8h.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 4273 bytes --]
At Tue, 26 Jul 2011 13:48:30 +0200,
Bastien wrote:
>
> > +;; 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?
Yes thats a typo, I was trying to select a more appropriate name for it.
> > +;; 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?
* Parent
** TODO Item 1
** TODO Item 2
** TODO Item 3
** TODO Item 4
** NEXT Item 5 Current (the one with TRIGGER property)
** TODO Item 6
** Item 7
** TODO Item 8
** DONE Item 9
Below are example list of candidates depending on option
from-top => 1,2,3,4,6,7,8
from-bottom => 8,7,6,4,3,2,1
from-current => 6,7,8,1,2,3,4
from-current,no-wrap => 6,7,8
Adding todo-only will eliminate item 7 from all of above, adding
include-done will include item 9.
After inital candidate list is established as above, its sorted by priority
or effort, then 1st item is made NEXT.
> > +;;
> > +;; - 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.
Agree, maybe whole option can be eliminated, I had an opposite option
initially (skip-done), to have default compatible with original
trigger, but decided that skipping done may be a better default.
> > +;; - 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?
todo-only excludes items without any todo keyword, ie plain
headlines. See example above on if item 7 is included or not.
include-done forces items with a DONE/CANCELLEd keyword to be considered
>
> What about using exclusive options like "todo-only" and
> "todo-and-done-only"? So that you would need to use only one.
I'm fine with that, will change.
> >
> > (require 'org)
> > +(require 'cl)
>
> this (eval-when-compile (require 'cl)) -- emacs has a policy of
> preventing (require 'cl) only...
I grepped *.el and saw other file using it without eval-when-compile
(it was htmlize.el i think), so I thought it was ok in contrib. My
worry was that using functions as opposite to macros needs it loaded,
since I use (remove-if) and (position)
But I just tested it on clean file and emacs -Q, and
(eval-when-compile (require 'cl)) and then using 'cl-seq functions
like remove-if seems to works fine.
I'll submit updated patch later today taken above comments inte
consideration. Attached is an org file where you can test various
options
> 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.
Attached is a test file you can use for all the situation that you
asked clarification for. After testing this file I'm thinking maybe
from-current should be a default instead of from-top. Basically I'm
open to suggestion as to the most sensible default options. I myself
use a hook that auto-inserts TRIGGER line i want when entry becomes
next, maybe such hook should be included into org-depend also? At
least as example?
[-- Attachment #2: org-depend-chain-find-next-test.org --]
[-- Type: application/octet-stream, Size: 2533 bytes --]
* Default
** TODO Item 1
** TODO Item 2
** TODO Item 3
** TODO Item 4
** NEXT Item 5 Current (mark me done)
:PROPERTIES:
:TRIGGER: chain-find-next(NEXT)
:END:
** TODO Item 6
** Item 7
** TODO Item 8
** DONE Item 9
* from-top (same as default)
** TODO Item 1
** TODO Item 2
** TODO Item 3
** TODO Item 4
** NEXT Item 5 Current (mark me done)
:PROPERTIES:
:TRIGGER: chain-find-next(NEXT,from-top)
:END:
** TODO Item 6
** Item 7
** TODO Item 8
** DONE Item 9
* from-bottom
** TODO Item 1
** TODO Item 2
** TODO Item 3
** TODO Item 4
** NEXT Item 5 Current (mark me done)
:PROPERTIES:
:TRIGGER: chain-find-next(NEXT,from-bottom)
:END:
** TODO Item 6
** Item 7
** TODO Item 8
** DONE Item 9
* from-current,priority-up
** TODO Item 1
** TODO Item 2
** TODO Item 3
** TODO [#A] Item 4
** NEXT Item 5 Current (mark me done)
:PROPERTIES:
:TRIGGER: chain-find-next(NEXT,from-current,priority-up)
:END:
** TODO Item 6
** Item 7
** TODO [#B] Item 8
** DONE Item 9
* from-current,no-wrap,priority-up
** TODO Item 1
** TODO Item 2
** TODO Item 3
** TODO [#A] Item 4
** NEXT Item 5 Current (mark me done)
:PROPERTIES:
:TRIGGER: chain-find-next(NEXT,from-current,no-wrap,priority-up)
:END:
** TODO Item 6
** Item 7
** TODO [#B] Item 8
** DONE Item 9
* from-current, without todo-only
** TODO Item 1
** TODO Item 2
** TODO Item 3
** TODO Item 4
** NEXT Item 5 Current (mark me done)
:PROPERTIES:
:TRIGGER: chain-find-next(NEXT,from-current)
:END:
** Item 6
** Item 7
** TODO Item 8
** DONE Item 9
* from-current, with todo-only
** TODO Item 1
** TODO Item 2
** TODO Item 3
** TODO Item 4
** NEXT Item 5 Current (mark me done)
:PROPERTIES:
:TRIGGER: chain-find-next(NEXT,from-current,todo-only)
:END:
** Item 6
** Item 7
** TODO Item 8
** DONE Item 9
* from-current without include-done
** TODO Item 1
** TODO Item 2
** TODO Item 3
** TODO Item 4
** NEXT Item 5 Current (mark me done)
:PROPERTIES:
:TRIGGER: chain-find-next(NEXT,from-current)
:END:
** DONE Item 6
CLOSED: [2011-07-26 Tue 17:49]
** Item 7
** TODO Item 8
** DONE Item 9
* from-current with include-done
** TODO Item 1
** TODO Item 2
** TODO Item 3
** TODO Item 4
** NEXT Item 5 Current (mark me done)
:PROPERTIES:
:TRIGGER: chain-find-next(NEXT,from-current,include-done)
:END:
** DONE Item 6
CLOSED: [2011-07-26 Tue 17:49]
** Item 7
** TODO Item 8
** DONE Item 9
* end
[-- Attachment #3: Type: text/plain, Size: 3 bytes --]
next prev parent reply other threads:[~2011-07-26 21:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-24 18:58 [PATCH] New org-depend trigger for finding next highest priority/effort item Max Mikhanosha
2011-07-26 11:48 ` Bastien
2011-07-26 12:52 ` Sebastien Vauban
2011-07-26 14:59 ` Bastien
2011-07-26 21:56 ` Max Mikhanosha [this message]
2011-07-27 11:33 ` Bastien
2011-07-27 19:45 ` Max Mikhanosha
2011-07-28 7:11 ` Bastien
2011-07-26 23:34 ` Max Mikhanosha
2011-07-27 11:33 ` Bastien
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=878vrk66zs.wl%max@openchat.com \
--to=max@openchat.com \
--cc=bzg@altern.org \
--cc=emacs-orgmode@gnu.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).