2

For my global TODO list, I am showing breadcrumbs as suggested here :

(concat \"[ \"(org-format-outline-path (org-get-outline-path)) \" ]\") ") 

to produce following:

enter image description here

enter image description here

I would like to show only the second level of project breadcrumb. So in this case, I would only display [Project A]. I think if I can make a function that can extract the second level, I just need to prepend with %? so that [Tasks] does not appear for Tasks, but only project names would appear for Projects. What would be an ideal way of extracting the second level?

Community
  • 1
  • 1
THIS USER NEEDS HELP
  • 3,136
  • 4
  • 30
  • 55

1 Answers1

3

All you have to do to get the second element of (org-get-outline-path) is to call nth.

(nth N LIST)

Return the Nth element of LIST. N counts from zero. If LIST is not that long, nil is returned.

The second element is (nth 1 LIST). Replace (org-get-outline-path) with (list (nth 1 (org-get-outline-path))) (we use list because that's what org-format-outline-path expects).

erikstokes
  • 1,197
  • 6
  • 15
  • Thanks so much! That worked out well. However, I still have one problem that I cannot figure out for some reason. Could you take a look at the problem [here](http://stackoverflow.com/questions/35910204/org-agenda-prefix-format-does-not-work)? – THIS USER NEEDS HELP Mar 10 '16 at 07:31