9

A custom multi-section agenda view can get quite long. Is there a built-in mechanism to fold or collapse sections like the standard outline view of org files to help with readability?

I'm interested in minimally being able to collapse individual sections of a multi-section agenda.

3 Answers 3

3

There is no such mechanism for org agendas. However, there is org-sparse-tree (C-c /) which will do and agenda-like search and instead of creating a new agenda buffer, will fold your org file to show only matching entries. However, your searches will be more limited than with org-agenda

3
  • org-sparse-tree is generally too limited. Folding below the top "level" of the agenda isn't a big deal; it's mainly in the interest of avoiding scrolling / switching between agenda views.
    – ebpa
    Mar 8, 2016 at 22:23
  • This is a really nice idea, even if it's not currently possible. Seems like we need a feature-request tracker for org. :)
    – user3871
    Mar 10, 2016 at 22:42
  • @ebpa unclear whether you can adapt the concepts in the following url: emacs.stackexchange.com/questions/40629/…
    – zugzwang
    May 21, 2018 at 22:04
3

I thought of this and found a solution today. Having came here via the first result from Google, I though I'd share it. The outline minor mode can be used to achieve this, exploiting the fact that the contents of individual agenda views are indented but the headers start from the first column:

    (setq-local outline-regexp "^[A-Z]")
    (setq-local outline-heading-end-regexp ".$")
    (setq-local outline-minor-mode-prefix "C-'")
    (outline-minor-mode)
    (local-set-key outline-minor-mode-prefix outline-mode-prefix-map)
2
  • 3
    this is a pretty neat idea, just as FYI addition yafolding-mode- which folds based on indentation- is able to do this off-the-shelf, including disclosure triangles.
    – Muihlinn
    Sep 19, 2019 at 11:42
  • Thank you, works great! Had to write (setq-local outline-minor-mode-prefix (kbd "C-'")) to make it work for me. Jan 4 at 8:38
1

As erikstokes said, and as much as I know, you can not fold it (*)

But you can - and probably should, given your apparent needs - filter by :tag: (/), or by :CATEGORY: (<), or by some of a few more criteria. Check it at WORG, org-mode's wiki: http://orgmode.org/worg/org-tutorials/agenda-filters.html

(*) well... you probably can code something, after all, it is Emacs, right? But I assume that is not the point here :-)

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.