From 4c1317d2021d8ef997b11797953baa5fb78aa4d9 Mon Sep 17 00:00:00 2001 From: KemoNine Date: Thu, 13 Apr 2023 18:06:55 -0400 Subject: [PATCH] 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 --- org/init.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/org/init.el b/org/init.el index 63c6ccb..5564c18 100644 --- a/org/init.el +++ b/org/init.el @@ -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)) + ) ) ) )