Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make origami fold default example work with daily and weekly agenda #195

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions examples.org
Original file line number Diff line number Diff line change
Expand Up @@ -371,16 +371,15 @@ You could even fold certain groups by default, perhaps like this (this ~use-pack

(defvar ap/org-super-agenda-auto-show-groups
'("Schedule" "Bills" "Priority A items" "Priority B items"))

(defun ap/org-super-agenda-origami-fold-default ()
"Fold certain groups by default in Org Super Agenda buffer."
(forward-line 3)
(cl-loop do (origami-forward-toggle-node (current-buffer) (point))
while (origami-forward-fold-same-level (current-buffer) (point)))
(--each ap/org-super-agenda-auto-show-groups
(goto-char (point-min))
(when (re-search-forward (rx-to-string `(seq bol " " ,it)) nil t)
(origami-show-node (current-buffer) (point)))))

(defun ap/org-super-agenda-origami-fold-default ()
(forward-line 3)
(cl-loop do (origami-forward-toggle-node (current-buffer) (point))
while (numberp (org-agenda-forward-block)))
(--each ap/org-super-agenda-auto-show-groups
(goto-char (point-min))
(when (re-search-forward (rx-to-string `(seq bol " " ,it)) nil t)
(origami-show-node (current-buffer) (point)))))

:hook ((org-agenda-mode . origami-mode)
(org-agenda-finalize . ap/org-super-agenda-origami-fold-default)))
Expand Down