dots

my dotfiles
git clone https://tilde.team/~marisa/repo/dots.git
Log | Files | Refs

commit 9cd87e2027051528446c7340881b6caea3040c2a
parent 1a0d29a74345dd3fc4c1b2c55032fc79cb69c7ba
Author: mokou <mokou@posteo.de>
Date:   Tue,  6 Oct 2020 11:08:48 +0200

Manually archive tasks

Diffstat:
Mdot_doom.d/config.el | 29+----------------------------
1 file changed, 1 insertion(+), 28 deletions(-)

diff --git a/dot_doom.d/config.el b/dot_doom.d/config.el @@ -96,14 +96,9 @@ (org-agenda-skip-function 'cf/skip-non-tasks) (org-tags-match-list-sublevels nil) (org-agenda-todo-ignore-scheduled cf/hide-scheduled-and-waiting-next-tasks) - (org-agenda-todo-ignore-deadlines cf/hide-scheduled-and-waiting-next-tasks))) - (tags "-REFILE/" - ((org-agenda-overriding-header "Tasks to Archive") - (org-agenda-skip-function 'cf/skip-non-archivable-tasks) - (org-tags-match-list-sublevels nil)))) + (org-agenda-todo-ignore-deadlines cf/hide-scheduled-and-waiting-next-tasks)))) nil))))) - (map! :map global-map :leader "a" 'org-agenda) (defvar cf/hide-scheduled-and-waiting-next-tasks t) @@ -164,25 +159,3 @@ nil) (t next-headline))))) - -(defun cf/skip-non-archivable-tasks () - (save-restriction - (widen) - ;; Consider only tasks with done todo headings as archivable candidates - (let ((next-headline (save-excursion (or (outline-next-heading) (point-max)))) - (subtree-end (save-excursion (org-end-of-subtree t)))) - (if (member (org-get-todo-state) org-todo-keywords-1) - (if (member (org-get-todo-state) org-done-keywords) - (let* ((daynr (string-to-number (format-time-string "%d" (current-time)))) - (a-month-ago (* 60 60 24 (+ daynr 1))) - (last-month (format-time-string "%Y-%m-" (time-subtract (current-time) (seconds-to-time a-month-ago)))) - (this-month (format-time-string "%Y-%m-" (current-time))) - (subtree-is-current (save-excursion - (forward-line 1) - (and (< (point) subtree-end) - (re-search-forward (concat last-month "\\|" this-month) subtree-end t))))) - (if subtree-is-current - subtree-end ; Has a date in this month or last month, skip it - nil)) ; available to archive - (or subtree-end (point-max))) - next-headline))))