emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Agenda views skip function hide parent projects
@ 2014-02-05 17:54 Wiskey 5 Alpha
  2014-02-05 19:40 ` Alan Schmitt
  2014-02-07 16:54 ` Wiskey 5 Alpha
  0 siblings, 2 replies; 5+ messages in thread
From: Wiskey 5 Alpha @ 2014-02-05 17:54 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1088 bytes --]

Hello all.

I am sure this is documented somewhere, but I cant seem to put together
the correct custom agenda view to support my way of project planning

I have the following todo keywords defined : TODO NEXT DONE WAIT
I like to list everything as a TODO, even if sub items may be a TODO, like
this

** TODO Main Test Project
*** TODO Main sub project 1
**** NEXT first task
*** TODO Main sub project 2 (stuck)

What I would like to see is :
on my projects list
TODO Main sub project 1

The problem is that my project list looks like this
TODO Main Test Project
TODO Main sub project 1

I have some projects that are 4 levels deep, so this is quite annoying.
 How do
I get just the "deepest" level project to show without it's parents ?

here is my custom agenda view for projects

("p" "@Projects" tags-todo "-IGNORE-someday-wait/TODO"
 (
  (org-agenda-overriding-header "@Projects")
          (org-agenda-tags-todo-honor-ignore-options t)
   (org-agenda-skip-function
   (lambda nil
     (org-agenda-skip-subtree-if (quote notregexp) "\\* NEXT")
     )
   )

Thank you in advance

-Tim

[-- Attachment #2: Type: text/html, Size: 1982 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Agenda views skip function hide parent projects
  2014-02-05 17:54 Agenda views skip function hide parent projects Wiskey 5 Alpha
@ 2014-02-05 19:40 ` Alan Schmitt
  2014-02-05 19:50   ` Samuel Wales
  2014-02-05 20:51   ` Wiskey 5 Alpha
  2014-02-07 16:54 ` Wiskey 5 Alpha
  1 sibling, 2 replies; 5+ messages in thread
From: Alan Schmitt @ 2014-02-05 19:40 UTC (permalink / raw)
  To: Wiskey 5 Alpha; +Cc: emacs-orgmode

Wiskey 5 Alpha <wiskey5alpha@gmail.com> writes:

> Hello all.
>
> I am sure this is documented somewhere, but I cant seem to put together
> the correct custom agenda view to support my way of project planning
>
> I have the following todo keywords defined : TODO NEXT DONE WAIT
> I like to list everything as a TODO, even if sub items may be a TODO,
> like this
>
> ** TODO Main Test Project
> *** TODO Main sub project 1
> **** NEXT first task
> *** TODO Main sub project 2 (stuck)
>
> What I would like to see is :
> on my projects list 
> TODO Main sub project 1
>
> The problem is that my project list looks like this
> TODO Main Test Project
> TODO Main sub project 1
>
> I have some projects that are 4 levels deep, so this is quite annoying.
> How do 
> I get just the "deepest" level project to show without it's parents ?

I highly recommend reading this: http://doc.norang.ca/org-mode.html

In particular, if you read this section
http://doc.norang.ca/org-mode.html#Projects you will find functions that
tell you if something is a project (i.e., is a task with a subtask).

I guess one could write something like this:

#+begin_src emacs-lisp
(defun bh/has-subproject-p ()
  "Any task with a todo keyword subtask that is a project"
  (save-restriction
    (widen)
    (let ((has-subproject)
          (subtree-end (save-excursion (org-end-of-subtree t)))
          (is-a-task (member (nth 2 (org-heading-components)) org-todo-keywords-1)))
      (save-excursion
        (forward-line 1)
        (while (and (not has-subproject)
                    (< (point) subtree-end)
                    (re-search-forward "^\*+ " subtree-end t))
          (when (bh/is-project-p)
            (setq has-subproject t))))
      (and is-a-task has-subtask))))
#end_src

then combine "is-project-p" and "has-subproject-p" to decide whether to
include something.

Alan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Agenda views skip function hide parent projects
  2014-02-05 19:40 ` Alan Schmitt
@ 2014-02-05 19:50   ` Samuel Wales
  2014-02-05 20:51   ` Wiskey 5 Alpha
  1 sibling, 0 replies; 5+ messages in thread
From: Samuel Wales @ 2014-02-05 19:50 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode, Wiskey 5 Alpha

it would be interesting to do this with dimming ancestors instead of
skipping them.  how would you do that?

it would also be interesting to dim descendants.

there is the blocked task concept, but that is different.

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  ANYBODY can get it.

Denmark: free Karina Hansen NOW.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Agenda views skip function hide parent projects
  2014-02-05 19:40 ` Alan Schmitt
  2014-02-05 19:50   ` Samuel Wales
@ 2014-02-05 20:51   ` Wiskey 5 Alpha
  1 sibling, 0 replies; 5+ messages in thread
From: Wiskey 5 Alpha @ 2014-02-05 20:51 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode

On Wed, Feb 5, 2014 at 2:40 PM, Alan Schmitt
<alan.schmitt@polytechnique.org> wrote:
>
> I highly recommend reading this: http://doc.norang.ca/org-mode.html
>
> Alan

Thank you for the reply.   I was hoping there was a function that did
the opposite of
'(org-tags-list-sublevels nil)'.  But if not, I will have to do
something similar to your
suggestion.

-Tim

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Agenda views skip function hide parent projects
  2014-02-05 17:54 Agenda views skip function hide parent projects Wiskey 5 Alpha
  2014-02-05 19:40 ` Alan Schmitt
@ 2014-02-07 16:54 ` Wiskey 5 Alpha
  1 sibling, 0 replies; 5+ messages in thread
From: Wiskey 5 Alpha @ 2014-02-07 16:54 UTC (permalink / raw)
  To: emacs-orgmode

On Wed, Feb 5, 2014 at 12:54 PM, Wiskey 5 Alpha <wiskey5alpha@gmail.com> wrote:
> I have some projects that are 4 levels deep, so this is quite annoying.  How
> do
> I get just the "deepest" level project to show without it's parents ?
>
> here is my custom agenda view for projects
>
> ("p" "@Projects" tags-todo "-IGNORE-someday-wait/TODO"
> (
>  (org-agenda-overriding-header "@Projects")
>           (org-agenda-tags-todo-honor-ignore-options t)
>    (org-agenda-skip-function
>   (lambda nil
>     (org-agenda-skip-subtree-if (quote notregexp) "\\* NEXT")
>     )
>   )
I think I understand the problem now, but i do not know how to fix it.
The skip function "matches" on the parent, as well as the siblings if
there is a NEXT item in the subtree.  Is there any way to limit the
search to only one level below the current level ?

-Tim

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-02-07 16:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-05 17:54 Agenda views skip function hide parent projects Wiskey 5 Alpha
2014-02-05 19:40 ` Alan Schmitt
2014-02-05 19:50   ` Samuel Wales
2014-02-05 20:51   ` Wiskey 5 Alpha
2014-02-07 16:54 ` Wiskey 5 Alpha

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).