17

I have a variety of (facile) tasks in some kind of hierarchy.

* TODO Make a pizza
** TODO Get cheese
*** TODO Buy a cow
** TODO Get tomatoes
*** TODO Grow tomatoes
**** TODO Buy tomatoes
** TODO Buy oven
*** TODO Win Lottery
**** TODO Buy Lottery ticket

If I view these in with the org agenda, they're displayed in a flat fashion:

  .TODO:    TODO Make a pizza
  .TODO:    TODO Get cheese
  .TODO:    TODO Buy a cow
  .TODO:    TODO Get tomatoes
  .TODO:    TODO Grow tomatoes
  .TODO:    TODO Buy tomatoes
  .TODO:    TODO Buy oven
  .TODO:    TODO Win Lottery
  .TODO:    TODO Buy Lottery ticket

I'd like to view these tasks in an indented fashion, so they reflect the dependencies between the tasks. Is this possible / a good idea or am I just using the agenda incorrectly?

2 Answers 2

12

Try customizing org-agenda-prefix-format. This can be used to tweak how various kinds of items (including TODOs) are displayed in agenda views.

In particular, you can use %l in the todo format to prefix the item with a number of spaces corresponding to its level in the hierarchy.

Another option would be to use %b to include a 'breadcrumb' trail for each line item showing the hierarchy, e.g. Level1 -> Level2: TODO Do the thing.

1
  • This works, but sometimes tasks are out of order. I.e, children are not beneath their parents sometimes. This happens if children have a different priority from their parents and can be set via org-agenda-sorting-strategy Feb 17, 2015 at 22:43
4

The variable org-tags-match-list-sublevels can do this:

Documentation: Non-nil means list also sublevels of headlines matching a search. This variable applies to tags/property searches, and also to stuck projects because this search is based on a tags match as well.

When set to the symbol `indented', sublevels are indented with leading dots.

With (setq org-tags-match-list-sublevels 'indented), a number of dots equal to the level will be prepended to each agenda line to indicate its level.

3
  • 1
    This doesn't seem to affect the agenda todo view for me (with Org 8.2.10 + Emacs 24.4).
    – glucas
    Dec 30, 2014 at 18:07
  • 2
    There are a few agenda buffer producing search functions used by org-mode and this variable may not necessarily apply to all of them [I have not tested this] -- the most common search functions are: org-agenda-list; org-tags-view; org-search-view.
    – lawlist
    Dec 30, 2014 at 19:32
  • 1
    @glucas You're right, it doesn't work in the global todo list. It does work in tag and tag-todo searches
    – erikstokes
    Dec 31, 2014 at 15:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.