From ba61f00f160416910fbcf2e81ef230f0853a1902 Mon Sep 17 00:00:00 2001 From: petrucci4prez Date: Tue, 5 Jun 2018 09:11:35 -0400 Subject: [PATCH] clear logs for clones and clean up custom agenda cmds --- conf.el | 161 +++++++++++++++++++++++++--------- conf.org | 256 ++++++++++++++++++++++++++++++++++++------------------- 2 files changed, 289 insertions(+), 128 deletions(-) diff --git a/conf.el b/conf.el index 651f6f6..20e630b 100644 --- a/conf.el +++ b/conf.el @@ -263,12 +263,14 @@ event of an error or nonlocal exit." (setq ess-history-directory (substitute-in-file-name "${XDG_CONFIG_HOME}/r/")) -(setq org-log-done t) (setq org-startup-indented t) (delight 'org-indent-mode) (setq org-directory "~/Org") (run-at-time "00:59" 3600 'org-save-all-org-buffers) +(setq org-log-into-drawer "LOGBOOK") +(setq org-log-done t) + (use-package org-bullets :ensure t :config @@ -393,12 +395,12 @@ event of an error or nonlocal exit." ("@errand" . ?e) ("@home" . ?h) ("@work" . ?w) - ("@travel" . ?t) + ("@travel" . ?r) (:endgroup) - ("#laptop" . ?L) - ("#tcult" . ?T) - ("#phone" . ?O) + ("#laptop" . ?l) + ("#tcult" . ?t) + ("#phone" . ?p) ("%note" . ?n) ("%inc" . ?i) @@ -919,7 +921,7 @@ tags that do not have tags in neg-tags-list" (message msg)) (defun nd/org-agenda-filter-non-context () -"A quick and dirty agenda filter that removes all + "A quick and dirty agenda filter that removes all tasks with context tags" (interactive) (let* ((tags-list (mapcar #'car org-tag-alist)) @@ -953,14 +955,14 @@ tasks with context tags" ((> pa pb) +1) ((< pa pb) -1))))) -(defun nd/agenda-base-header-command (match header skip-fun) +(defun nd/agenda-base-header-cmd (match header skip-fun) `(tags ,match ((org-agenda-overriding-header ,header) (org-agenda-skip-function ,skip-fun) (org-agenda-sorting-strategy '(category-keep))))) -(defun nd/agenda-base-task-command (match header skip-fun &optional sort) +(defun nd/agenda-base-task-cmd (match header skip-fun &optional sort) (or sort (setq sort ''(category-keep))) `(tags-todo ,match @@ -969,74 +971,135 @@ tasks with context tags" (org-agenda-todo-ignore-with-date t) (org-agenda-sorting-strategy ,sort)))) -(defun nd/agenda-base-project-command (match header statuscode) - `(tags +(defun nd/agenda-base-proj-cmd (match header statuscode) + `(tags-todo ,match ((org-agenda-overriding-header (concat (and nd/agenda-limit-project-toplevel "Toplevel ") ,header)) (org-agenda-skip-function '(nd/skip-projects-without-statuscode ,statuscode)) (org-agenda-sorting-strategy '(category-keep))))) -(let ((task-match "-NA-REFILE-%inc-PARENT_TYPE=\"periodical\"/") - (project-match "-NA-REFILE-%inc-PARENT_TYPE=\"periodical\"-PARENT_TYPE=\"iterator\"/") - (periodical-match "-NA-REFILE+PARENT_TYPE=\"periodical\"-PARENT_TYPE=\"iterator\"/") - (iterator-match "-NA-REFILE-PARENT_TYPE=\"periodical\"+PARENT_TYPE=\"iterator\"/")) +(let* ((actionable "-NA-REFILE-%inc") + (periodical "PARENT_TYPE=\"periodical\"") + (iterator "PARENT_TYPE=\"iterator\"") + (task-match (concat actionable "-" periodical "/!")) + (act-no-rep-match (concat actionable "-" periodical "-" iterator "/!")) + (peri-match (concat actionable "+" periodical "-" iterator "/!")) + (iter-match (concat actionable "-" periodical "+" iterator "/!"))) + (setq org-agenda-custom-commands `(("t" "Task View" ((agenda "" (org-agenda-skip-function '(nd/skip-headings-with-tags '("%inc")))) - ,(nd/agenda-base-task-command project-match + ,(nd/agenda-base-task-cmd act-no-rep-match "Project Tasks" ''nd/skip-non-project-tasks ''(user-defined-up category-keep)) - ,(nd/agenda-base-task-command project-match + ,(nd/agenda-base-task-cmd act-no-rep-match "Atomic Tasks" ''nd/skip-non-atomic-tasks))) + ("p" "Project View" - (,(nd/agenda-base-project-command project-match "Stuck Projects" :stuck) - ,(nd/agenda-base-project-command project-match "Waiting Projects" :waiting) - ,(nd/agenda-base-project-command project-match "Active Projects" :active) - ,(nd/agenda-base-project-command project-match "Held Projects" :held))) + (,(nd/agenda-base-proj-cmd act-no-rep-match + "Stuck Projects" + :stuck) + ,(nd/agenda-base-proj-cmd act-no-rep-match + "Waiting Projects" + :waiting) + ,(nd/agenda-base-proj-cmd act-no-rep-match + "Active Projects" + :active) + ,(nd/agenda-base-proj-cmd act-no-rep-match + "Held Projects" + :held))) + ("P" "Periodical View" - (,(nd/agenda-base-header-command periodical-match "Empty Periodicals" ''nd/skip-non-empty-periodical-parent-headers) - ,(nd/agenda-base-header-command periodical-match "Stale Periodicals" ''nd/skip-non-stale-periodical-parent-headers) - ,(nd/agenda-base-header-command periodical-match "Fresh Periodicals" ''nd/skip-non-fresh-periodical-parent-headers))) + (,(nd/agenda-base-header-cmd peri-match + "Empty Periodicals" + ''nd/skip-non-empty-periodical-parent-headers) + ,(nd/agenda-base-header-cmd peri-match + "Stale Periodicals" + ''nd/skip-non-stale-periodical-parent-headers) + ,(nd/agenda-base-header-cmd peri-match + "Fresh Periodicals" + ''nd/skip-non-fresh-periodical-parent-headers))) + ("i" "Iterator View" - (,(nd/agenda-base-project-command iterator-match "Stuck Iterators (require NEXT or schedule)" :stuck) - ,(nd/agenda-base-project-command iterator-match "Empty Iterators (require new tasks)" :undone-complete) - ,(nd/agenda-base-task-command iterator-match "Uninitialized Iterators (no tasks added)" ''nd/skip-non-iterator-atomic-tasks) - ,(nd/agenda-base-project-command iterator-match "Active Iterators" :active) - ,(nd/agenda-base-project-command iterator-match "Waiting Iterators" :waiting) - ,(nd/agenda-base-project-command iterator-match "Held Iterators" :held))) + (,(nd/agenda-base-proj-cmd iter-match + "Stuck Iterators (require NEXT or schedule)" + :stuck) + ,(nd/agenda-base-proj-cmd iter-match + "Empty Iterators (require new tasks)" + :undone-complete) + ,(nd/agenda-base-task-cmd iter-match + "Uninitialized Iterators (no tasks added)" + ''nd/skip-non-iterator-atomic-tasks) + ,(nd/agenda-base-proj-cmd iter-match + "Active Iterators" + :active) + ,(nd/agenda-base-proj-cmd iter-match + "Waiting Iterators" + :waiting) + ,(nd/agenda-base-proj-cmd iter-match + "Held Iterators" + :held))) + ("I" "Incubator View" ((agenda "" ((org-agenda-span 7) (org-agenda-time-grid nil) (org-agenda-entry-types '(:deadline :timestamp)))) - ,(nd/agenda-base-task-command "-NA-REFILE+%inc/" "Incubated Tasks" ''nd/skip-non-atomic-tasks) - ,(nd/agenda-base-project-command "-NA-REFILE+%inc/" "Incubated Projects" :held))) + ,(nd/agenda-base-task-cmd "-NA-REFILE+%inc/!" + "Incubated Tasks" + ''nd/skip-non-atomic-tasks) + ,(nd/agenda-base-proj-cmd "-NA-REFILE+%inc/!" + "Incubated Projects" + :held))) + ("r" "Refile and Critical Errors" ((tags "REFILE" ((org-agenda-overriding-header "Tasks to Refile")) (org-tags-match-list-sublevels nil)) - ,(nd/agenda-base-task-command task-match "Discontinous Project" ''nd/skip-non-discontinuous-project-tasks) - ,(nd/agenda-base-project-command project-match "Invalid Todostate" :invalid-todostate))) + ,(nd/agenda-base-task-cmd task-match + "Discontinous Project" + ''nd/skip-non-discontinuous-project-tasks) + ,(nd/agenda-base-proj-cmd act-no-rep-match + "Invalid Todostate" + :invalid-todostate))) + ("e" "Non-critical Errors" - (,(nd/agenda-base-header-command task-match "Undone Closed" ''nd/skip-non-undone-closed-todoitems) - ,(nd/agenda-base-header-command task-match "Done Unclosed" ''nd/skip-non-done-unclosed-todoitems) - ,(nd/agenda-base-project-command task-match "Undone Completed" :undone-complete) - ,(nd/agenda-base-project-command task-match "Done Incompleted" :done-incomplete))) + (,(nd/agenda-base-header-cmd task-match + "Undone Closed" + ''nd/skip-non-undone-closed-todoitems) + ,(nd/agenda-base-header-cmd (concat actionable "-" periodical) + "Done Unclosed" + ''nd/skip-non-done-unclosed-todoitems) + ,(nd/agenda-base-proj-cmd task-match + "Undone Completed" + :undone-complete) + ,(nd/agenda-base-proj-cmd (concat actionable "-" periodical) + "Done Incompleted" + :done-incomplete))) + ("A" "Archivable Tasks and Projects" - (,(nd/agenda-base-header-command task-match "Archivable Atomic Tasks" ''nd/skip-non-archivable-atomic-tasks) - ,(nd/agenda-base-header-command task-match "Stale Tasks" ''nd/skip-non-stale-headings) - ,(nd/agenda-base-project-command iterator-match "Archivable Iterators" :archivable) - ,(nd/agenda-base-project-command project-match "Archivable Projects" :archivable)))))) + (,(nd/agenda-base-header-cmd (concat actionable "-" periodical) + "Archivable Atomic Tasks" + ''nd/skip-non-archivable-atomic-tasks) + ,(nd/agenda-base-header-cmd (concat actionable "-" periodical) + "Stale Tasks" + ''nd/skip-non-stale-headings) + ,(nd/agenda-base-proj-cmd (concat actionable "-" periodical "+" iterator) + "Archivable Iterators" + :archivable) + ,(nd/agenda-base-proj-cmd (concat actionable "-" periodical "-" iterator) + "Archivable Projects" + :archivable)))))) (setq org-agenda-start-on-weekday 0) (setq org-agenda-span 'day) @@ -1100,6 +1163,7 @@ and reverts all todo keywords to TODO" (org-forward-heading-same-level 1 t) (org-reset-checkbox-state-subtree) (nd/mark-subtree-keyword "TODO") + (call-interactively 'nd/org-log-delete) (org-cycle) ;; clone reset tree again if we need more than one clone (if (> n 1) @@ -1110,6 +1174,21 @@ and reverts all todo keywords to TODO" (org-cycle)))))) (error (message "%s" (error-message-string err)))))) +(defun nd/org-log-delete () + "Delete logbook drawer of subtree." + (interactive) + (save-excursion + (goto-char (org-log-beginning)) + (when (save-excursion + (save-match-data + (beginning-of-line 0) + (search-forward-regexp org-drawer-regexp) + (goto-char (match-beginning 1)) + (looking-at "LOGBOOK"))) + (org-mark-element) + (delete-region (region-beginning) (region-end)) + (org-remove-empty-drawer-at (point))))) + (use-package calfw-org :init :ensure t diff --git a/conf.org b/conf.org index f572796..d8c38ab 100644 --- a/conf.org +++ b/conf.org @@ -401,12 +401,16 @@ event of an error or nonlocal exit." * org-mode ** basic #+BEGIN_SRC emacs-lisp -(setq org-log-done t) (setq org-startup-indented t) (delight 'org-indent-mode) (setq org-directory "~/Org") (run-at-time "00:59" 3600 'org-save-all-org-buffers) #+END_SRC +** logging +#+BEGIN_SRC emacs-lisp +(setq org-log-into-drawer "LOGBOOK") +(setq org-log-done t) +#+END_SRC ** ui *** bullets #+BEGIN_SRC emacs-lisp @@ -580,12 +584,12 @@ There are several types of tags I use: ("@errand" . ?e) ("@home" . ?h) ("@work" . ?w) - ("@travel" . ?t) + ("@travel" . ?r) (:endgroup) - ("#laptop" . ?L) - ("#tcult" . ?T) - ("#phone" . ?O) + ("#laptop" . ?l) + ("#tcult" . ?t) + ("#phone" . ?p) ("%note" . ?n) ("%inc" . ?i) @@ -1094,23 +1098,23 @@ futher action. (TODO = stuck which I take care of at the project level, and DONE/CANC = archivable which is dealt with similarly) #+BEGIN_SRC emacs-lisp - (defun nd/skip-non-project-tasks () - (save-restriction - (widen) - (let ((keyword (nd/is-todoitem-p))) - (if keyword - (if (nd/heading-has-children 'nd/is-todoitem-p) - (if (member keyword nd/project-skip-todostates) - (nd/skip-subtree) - (nd/skip-heading)) - (if (not (and (nd/heading-has-parent 'nd/is-todoitem-p) - (not (nd/is-timestamped-heading-p)) - (not (nd/is-scheduled-heading-p)) - (not (nd/is-deadlined-heading-p)) - ;; (equal keyword skip-keyword) - )) - (nd/skip-heading))) - (nd/skip-heading))))) +(defun nd/skip-non-project-tasks () + (save-restriction + (widen) + (let ((keyword (nd/is-todoitem-p))) + (if keyword + (if (nd/heading-has-children 'nd/is-todoitem-p) + (if (member keyword nd/project-skip-todostates) + (nd/skip-subtree) + (nd/skip-heading)) + (if (not (and (nd/heading-has-parent 'nd/is-todoitem-p) + (not (nd/is-timestamped-heading-p)) + (not (nd/is-scheduled-heading-p)) + (not (nd/is-deadlined-heading-p)) + ;; (equal keyword skip-keyword) + )) + (nd/skip-heading))) + (nd/skip-heading))))) #+END_SRC **** header-level errors @@ -1184,40 +1188,40 @@ when the iterator will run out #+END_SRC *** interactive view functions #+BEGIN_SRC emacs-lisp - (defvar nd/agenda-limit-project-toplevel t - "used to filter projects by all levels or top-level only") +(defvar nd/agenda-limit-project-toplevel t + "used to filter projects by all levels or top-level only") - (defvar nd/agenda-hide-incubator-tags t - "used to filter incubator headings") +(defvar nd/agenda-hide-incubator-tags t + "used to filter incubator headings") - (defun nd/toggle-project-toplevel-display () - (interactive) - (setq nd/agenda-limit-project-toplevel (not nd/agenda-limit-project-toplevel)) - (when (equal major-mode 'org-agenda-mode) - (org-agenda-redo)) - (message "Showing %s project view in agenda" - (if nd/agenda-limit-project-toplevel "toplevel" "complete"))) +(defun nd/toggle-project-toplevel-display () + (interactive) + (setq nd/agenda-limit-project-toplevel (not nd/agenda-limit-project-toplevel)) + (when (equal major-mode 'org-agenda-mode) + (org-agenda-redo)) + (message "Showing %s project view in agenda" + (if nd/agenda-limit-project-toplevel "toplevel" "complete"))) - (defun nd/toggle-agenda-var (var msg) - (interactive) - (set var (not (eval var))) - (when (equal major-mode 'org-agenda-mode) - (org-agenda-redo)) - (message msg)) +(defun nd/toggle-agenda-var (var msg) + (interactive) + (set var (not (eval var))) + (when (equal major-mode 'org-agenda-mode) + (org-agenda-redo)) + (message msg)) - (defun nd/org-agenda-filter-non-context () +(defun nd/org-agenda-filter-non-context () "A quick and dirty agenda filter that removes all - tasks with context tags" - (interactive) - (let* ((tags-list (mapcar #'car org-tag-alist)) - (context-tags (append - (nd/filter-list-prefix "@" tags-list) - (nd/filter-list-prefix "#" tags-list)))) - (setq org-agenda-tag-filter - (mapcar (lambda(tag) (concat "-" tag)) context-tags)) - (org-agenda-filter-apply org-agenda-tag-filter 'tag))) +tasks with context tags" + (interactive) + (let* ((tags-list (mapcar #'car org-tag-alist)) + (context-tags (append + (nd/filter-list-prefix "@" tags-list) + (nd/filter-list-prefix "#" tags-list)))) + (setq org-agenda-tag-filter + (mapcar (lambda(tag) (concat "-" tag)) context-tags)) + (org-agenda-filter-apply org-agenda-tag-filter 'tag))) #+END_SRC -*** custom commands +*** agenda aesthetics #+BEGIN_SRC emacs-lisp (setq org-agenda-tags-todo-honor-ignore-options t) @@ -1241,15 +1245,17 @@ when the iterator will run out (cond ((or (null pa) (null pb)) nil) ((> pa pb) +1) ((< pa pb) -1))))) - -(defun nd/agenda-base-header-command (match header skip-fun) +#+END_SRC +*** custom commands +#+BEGIN_SRC emacs-lisp +(defun nd/agenda-base-header-cmd (match header skip-fun) `(tags ,match ((org-agenda-overriding-header ,header) (org-agenda-skip-function ,skip-fun) (org-agenda-sorting-strategy '(category-keep))))) -(defun nd/agenda-base-task-command (match header skip-fun &optional sort) +(defun nd/agenda-base-task-cmd (match header skip-fun &optional sort) (or sort (setq sort ''(category-keep))) `(tags-todo ,match @@ -1258,75 +1264,135 @@ when the iterator will run out (org-agenda-todo-ignore-with-date t) (org-agenda-sorting-strategy ,sort)))) -(defun nd/agenda-base-project-command (match header statuscode) - `(tags +(defun nd/agenda-base-proj-cmd (match header statuscode) + `(tags-todo ,match ((org-agenda-overriding-header (concat (and nd/agenda-limit-project-toplevel "Toplevel ") ,header)) (org-agenda-skip-function '(nd/skip-projects-without-statuscode ,statuscode)) (org-agenda-sorting-strategy '(category-keep))))) -(let ((task-match "-NA-REFILE-%inc-PARENT_TYPE=\"periodical\"/") - (project-match "-NA-REFILE-%inc-PARENT_TYPE=\"periodical\"-PARENT_TYPE=\"iterator\"/") - (periodical-match "-NA-REFILE+PARENT_TYPE=\"periodical\"-PARENT_TYPE=\"iterator\"/") - (iterator-match "-NA-REFILE-PARENT_TYPE=\"periodical\"+PARENT_TYPE=\"iterator\"/")) +(let* ((actionable "-NA-REFILE-%inc") + (periodical "PARENT_TYPE=\"periodical\"") + (iterator "PARENT_TYPE=\"iterator\"") + (task-match (concat actionable "-" periodical "/!")) + (act-no-rep-match (concat actionable "-" periodical "-" iterator "/!")) + (peri-match (concat actionable "+" periodical "-" iterator "/!")) + (iter-match (concat actionable "-" periodical "+" iterator "/!"))) + (setq org-agenda-custom-commands `(("t" "Task View" ((agenda "" (org-agenda-skip-function '(nd/skip-headings-with-tags '("%inc")))) - ,(nd/agenda-base-task-command project-match + ,(nd/agenda-base-task-cmd act-no-rep-match "Project Tasks" ''nd/skip-non-project-tasks ''(user-defined-up category-keep)) - ,(nd/agenda-base-task-command project-match + ,(nd/agenda-base-task-cmd act-no-rep-match "Atomic Tasks" ''nd/skip-non-atomic-tasks))) + ("p" "Project View" - (,(nd/agenda-base-project-command project-match "Stuck Projects" :stuck) - ,(nd/agenda-base-project-command project-match "Waiting Projects" :waiting) - ,(nd/agenda-base-project-command project-match "Active Projects" :active) - ,(nd/agenda-base-project-command project-match "Held Projects" :held))) + (,(nd/agenda-base-proj-cmd act-no-rep-match + "Stuck Projects" + :stuck) + ,(nd/agenda-base-proj-cmd act-no-rep-match + "Waiting Projects" + :waiting) + ,(nd/agenda-base-proj-cmd act-no-rep-match + "Active Projects" + :active) + ,(nd/agenda-base-proj-cmd act-no-rep-match + "Held Projects" + :held))) + ("P" "Periodical View" - (,(nd/agenda-base-header-command periodical-match "Empty Periodicals" ''nd/skip-non-empty-periodical-parent-headers) - ,(nd/agenda-base-header-command periodical-match "Stale Periodicals" ''nd/skip-non-stale-periodical-parent-headers) - ,(nd/agenda-base-header-command periodical-match "Fresh Periodicals" ''nd/skip-non-fresh-periodical-parent-headers))) + (,(nd/agenda-base-header-cmd peri-match + "Empty Periodicals" + ''nd/skip-non-empty-periodical-parent-headers) + ,(nd/agenda-base-header-cmd peri-match + "Stale Periodicals" + ''nd/skip-non-stale-periodical-parent-headers) + ,(nd/agenda-base-header-cmd peri-match + "Fresh Periodicals" + ''nd/skip-non-fresh-periodical-parent-headers))) + ("i" "Iterator View" - (,(nd/agenda-base-project-command iterator-match "Stuck Iterators (require NEXT or schedule)" :stuck) - ,(nd/agenda-base-project-command iterator-match "Empty Iterators (require new tasks)" :undone-complete) - ,(nd/agenda-base-task-command iterator-match "Uninitialized Iterators (no tasks added)" ''nd/skip-non-iterator-atomic-tasks) - ,(nd/agenda-base-project-command iterator-match "Active Iterators" :active) - ,(nd/agenda-base-project-command iterator-match "Waiting Iterators" :waiting) - ,(nd/agenda-base-project-command iterator-match "Held Iterators" :held))) + (,(nd/agenda-base-proj-cmd iter-match + "Stuck Iterators (require NEXT or schedule)" + :stuck) + ,(nd/agenda-base-proj-cmd iter-match + "Empty Iterators (require new tasks)" + :undone-complete) + ,(nd/agenda-base-task-cmd iter-match + "Uninitialized Iterators (no tasks added)" + ''nd/skip-non-iterator-atomic-tasks) + ,(nd/agenda-base-proj-cmd iter-match + "Active Iterators" + :active) + ,(nd/agenda-base-proj-cmd iter-match + "Waiting Iterators" + :waiting) + ,(nd/agenda-base-proj-cmd iter-match + "Held Iterators" + :held))) + ("I" "Incubator View" ((agenda "" ((org-agenda-span 7) (org-agenda-time-grid nil) (org-agenda-entry-types '(:deadline :timestamp)))) - ,(nd/agenda-base-task-command "-NA-REFILE+%inc/" "Incubated Tasks" ''nd/skip-non-atomic-tasks) - ,(nd/agenda-base-project-command "-NA-REFILE+%inc/" "Incubated Projects" :held))) + ,(nd/agenda-base-task-cmd "-NA-REFILE+%inc/!" + "Incubated Tasks" + ''nd/skip-non-atomic-tasks) + ,(nd/agenda-base-proj-cmd "-NA-REFILE+%inc/!" + "Incubated Projects" + :held))) + ("r" "Refile and Critical Errors" ((tags "REFILE" ((org-agenda-overriding-header "Tasks to Refile")) (org-tags-match-list-sublevels nil)) - ,(nd/agenda-base-task-command task-match "Discontinous Project" ''nd/skip-non-discontinuous-project-tasks) - ,(nd/agenda-base-project-command project-match "Invalid Todostate" :invalid-todostate))) + ,(nd/agenda-base-task-cmd task-match + "Discontinous Project" + ''nd/skip-non-discontinuous-project-tasks) + ,(nd/agenda-base-proj-cmd act-no-rep-match + "Invalid Todostate" + :invalid-todostate))) + ("e" "Non-critical Errors" - (,(nd/agenda-base-header-command task-match "Undone Closed" ''nd/skip-non-undone-closed-todoitems) - ,(nd/agenda-base-header-command task-match "Done Unclosed" ''nd/skip-non-done-unclosed-todoitems) - ,(nd/agenda-base-project-command task-match "Undone Completed" :undone-complete) - ,(nd/agenda-base-project-command task-match "Done Incompleted" :done-incomplete))) + (,(nd/agenda-base-header-cmd task-match + "Undone Closed" + ''nd/skip-non-undone-closed-todoitems) + ,(nd/agenda-base-header-cmd (concat actionable "-" periodical) + "Done Unclosed" + ''nd/skip-non-done-unclosed-todoitems) + ,(nd/agenda-base-proj-cmd task-match + "Undone Completed" + :undone-complete) + ,(nd/agenda-base-proj-cmd (concat actionable "-" periodical) + "Done Incompleted" + :done-incomplete))) + ("A" "Archivable Tasks and Projects" - (,(nd/agenda-base-header-command task-match "Archivable Atomic Tasks" ''nd/skip-non-archivable-atomic-tasks) - ,(nd/agenda-base-header-command task-match "Stale Tasks" ''nd/skip-non-stale-headings) - ,(nd/agenda-base-project-command iterator-match "Archivable Iterators" :archivable) - ,(nd/agenda-base-project-command project-match "Archivable Projects" :archivable)))))) - + (,(nd/agenda-base-header-cmd (concat actionable "-" periodical) + "Archivable Atomic Tasks" + ''nd/skip-non-archivable-atomic-tasks) + ,(nd/agenda-base-header-cmd (concat actionable "-" periodical) + "Stale Tasks" + ''nd/skip-non-stale-headings) + ,(nd/agenda-base-proj-cmd (concat actionable "-" periodical "+" iterator) + "Archivable Iterators" + :archivable) + ,(nd/agenda-base-proj-cmd (concat actionable "-" periodical "-" iterator) + "Archivable Projects" + :archivable)))))) #+END_SRC *** views **** calendar display @@ -1402,6 +1468,7 @@ and reverts all todo keywords to TODO" (org-forward-heading-same-level 1 t) (org-reset-checkbox-state-subtree) (nd/mark-subtree-keyword "TODO") + (call-interactively 'nd/org-log-delete) (org-cycle) ;; clone reset tree again if we need more than one clone (if (> n 1) @@ -1411,6 +1478,21 @@ and reverts all todo keywords to TODO" (org-forward-heading-same-level 1 t) (org-cycle)))))) (error (message "%s" (error-message-string err)))))) + +(defun nd/org-log-delete () + "Delete logbook drawer of subtree." + (interactive) + (save-excursion + (goto-char (org-log-beginning)) + (when (save-excursion + (save-match-data + (beginning-of-line 0) + (search-forward-regexp org-drawer-regexp) + (goto-char (match-beginning 1)) + (looking-at "LOGBOOK"))) + (org-mark-element) + (delete-region (region-beginning) (region-end)) + (org-remove-empty-drawer-at (point))))) #+END_SRC ** caldav +BEGIN_SRC emacs-lisp