tie origami to org super agenda and auto-hide some low-priority groupings by default

This commit is contained in:
KemoNine 2023-02-13 12:12:29 -05:00
parent f989fbeedf
commit b7287c50f8
2 changed files with 19 additions and 0 deletions

View File

@ -126,10 +126,12 @@
; origami config
(use-package origami
:demand
:config
(define-prefix-command 'origami-mode-map)
(define-key ctl-x-map (kbd "z") 'origami-mode-map)
(global-origami-mode)
:bind
(:map origami-mode-map
("o" . origami-open-node)

View File

@ -177,3 +177,20 @@
persp-add-buffer-on-after-change-major-mode)
:hooks '(after-switch-to-buffer-functions)
:switch 'window)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; origami + super agenda config
(defvar ap/org-super-agenda-auto-hide-groups
'("Slip Box" "Low Priority"))
(defun ap/org-super-agenda-origami-fold-default ()
"Fold certain groups by default in Org Super Agenda buffer."
(forward-line 3)
(--each ap/org-super-agenda-auto-hide-groups
(goto-char (point-min))
(cl-loop do (origami-close-node (current-buffer) (point))
while (re-search-forward (rx-to-string `(seq bol " " ,it)) nil t))))
(add-hook 'org-agenda-mode-hook #'origami-mode)
(add-hook 'org-agenda-finalize-hook #'ap/org-super-agenda-origami-fold-default)