convert org agenda folding via origami to use raw regex and to auto-collapse any auto-parented items with '(desc)' at the end of the heading

This commit is contained in:
KemoNine 2023-04-13 18:06:55 -04:00
parent e4e0d7a697
commit 4c1317d202
1 changed files with 10 additions and 3 deletions

View File

@ -210,15 +210,22 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; origami + super agenda config
(defvar ap/org-super-agenda-auto-hide-groups
'("Low Priority"))
'(".*Low Priority.*" "^.*?[^R]+.*?(desc)$"))
(defun ap/org-super-agenda-origami-fold-default ()
"Fold certain groups by default in Org Super Agenda buffer."
(--each ap/org-super-agenda-auto-hide-groups
(goto-char (point-min))
(cl-loop
while (re-search-forward (rx-to-string `(seq bol " " ,it)) nil t)
do (origami-close-node (current-buffer) (point))
while (re-search-forward it nil t)
do
(if (not (or
(string-match "TODO" (thing-at-point 'line))
(string-match "READY" (thing-at-point 'line))
(string-match "WIP" (thing-at-point 'line))
))
(origami-close-node (current-buffer) (point))
)
)
)
)