Archived
1
0
Fork 0

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 ; origami config
(use-package origami (use-package origami
:demand :demand
:config :config
(define-prefix-command 'origami-mode-map) (define-prefix-command 'origami-mode-map)
(define-key ctl-x-map (kbd "z") 'origami-mode-map) (define-key ctl-x-map (kbd "z") 'origami-mode-map)
(global-origami-mode) (global-origami-mode)
:bind :bind
(:map origami-mode-map (:map origami-mode-map
("o" . origami-open-node) ("o" . origami-open-node)

View file

@ -177,3 +177,20 @@
persp-add-buffer-on-after-change-major-mode) persp-add-buffer-on-after-change-major-mode)
:hooks '(after-switch-to-buffer-functions) :hooks '(after-switch-to-buffer-functions)
:switch 'window))) :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)