more updates

This commit is contained in:
petrucci4prez 2018-05-13 20:15:00 -04:00
parent e592fbd712
commit b742356b3f
2 changed files with 457 additions and 272 deletions

292
conf.el
View File

@ -61,7 +61,8 @@
:ensure t :ensure t
:config :config
(dashboard-setup-startup-hook) (dashboard-setup-startup-hook)
(setq dashboard-items '((recents . 10)))) (setq dashboard-banner-logo-title "Emacs"))
;; (setq dashboard-items '((recents . 10))))
(global-set-key (kbd "C-h a") 'apropos) (global-set-key (kbd "C-h a") 'apropos)
@ -117,7 +118,8 @@
:ensure t :ensure t
:delight :delight
:init :init
(add-hook 'prog-mode-hook #'rainbow-delimiters-mode)) (add-hook 'prog-mode-hook #'rainbow-delimiters-mode)
(add-hook 'ess-mode-hook #'rainbow-delimiters-mode))
(use-package ace-window (use-package ace-window
:ensure t :ensure t
@ -267,6 +269,20 @@
(local-set-key (kbd "C-c C-x x") 'nd/mark-subtree-done) (local-set-key (kbd "C-c C-x x") 'nd/mark-subtree-done)
(local-set-key (kbd "C-c C-x c") 'nd/org-clone-subtree-with-time-shift-reset))) (local-set-key (kbd "C-c C-x c") 'nd/org-clone-subtree-with-time-shift-reset)))
(evil-define-key 'motion org-agenda-mode-map
"t" 'nd/toggle-project-toplevel-display
"D" 'org-agenda-day-view
"W" 'org-agenda-week-view
"M" 'org-agenda-month-view
"Y" 'org-agenda-year-view
"ct" nil
"e" 'org-agenda-set-effort
"ce" nil)
(add-hook 'org-agenda-mode-hook
(lambda ()
(local-set-key (kbd "C-c C-c") '(message org-tags-alist))))
(setq org-todo-keywords (setq org-todo-keywords
'((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d)") '((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d)")
(sequence "WAIT(w@/!)" "HOLD(h@/!)" "|" "CANC(c@/!)"))) (sequence "WAIT(w@/!)" "HOLD(h@/!)" "|" "CANC(c@/!)")))
@ -279,18 +295,43 @@
("HOLD" :foreground "violet" :weight bold) ("HOLD" :foreground "violet" :weight bold)
("CANC" :foreground "deep sky blue" :weight bold)))) ("CANC" :foreground "deep sky blue" :weight bold))))
(setq org-tag-alist '((:startgroup) (defun nd/filter-tags-prefix (prefix tags-list)
"Return a subset of tags-list whose first character matches prefix.'
tags-list defaults to org-tag-alist if not given"
(seq-filter (lambda (tag)
(and (stringp tag)
(string-prefix-p prefix tag)))
tags-list))
(defun nd/add-tag-face (fg-name prefix)
"Adds list of cons cells to org-tag-faces with foreground set to fg-name.
Start and end specify the positions in org-tag-alist which define the tags
to which the faces are applied"
(dolist (tag (nd/filter-tags-prefix prefix (mapcar #'car org-tag-alist)))
(push `(,tag . (:foreground ,fg-name)) org-tag-faces)))
;; for some reason, org-mode doesn't like it if the org-tags-alist
;; has special chars before it is loaded (overrides keybindings)
;; this somewhat convoluted hook works tho...
(defun nd/set-org-tag-alist-and-faces ()
(progn
;; dirty hack to keep org agenda happy
;; (setq org-tag-alist '((:newline)))
(setq org-tag-alist
'((:startgroup)
("@errand" . ?e) ("@errand" . ?e)
("@work" . ?w)
("@home" . ?h) ("@home" . ?h)
("@work" . ?w)
("@travel" . ?t) ("@travel" . ?t)
(:endgroup) (:endgroup)
("#laptop" . ?L) ("#laptop" . ?L)
("#tcult" . ?T) ("#tcult" . ?T)
("#phone" . ?O)
("%note" . ?n) ("$note" . ?n)
("%subdiv" . ?s) ("$inc" . ?i)
("$subdiv" . ?s)
(:startgroup) (:startgroup)
("_env" . ?E) ("_env" . ?E)
@ -303,26 +344,20 @@
("_soc" . ?S) ("_soc" . ?S)
(:endgroup))) (:endgroup)))
;; not the most elegant but this will work (setq org-tag-faces '())
(setq org-tag-faces '())
(defun nd/add-tag-face (fg-name start end) (nd/add-tag-face "PaleGreen" "@")
"Adds list of cons cells to org-tag-faces with foreground set to fg-name. (nd/add-tag-face "SkyBlue" "#")
Start and end specify the positions in org-tag-alist which define the tags (nd/add-tag-face "PaleGoldenrod" "$")
to which the faces are applied" (nd/add-tag-face "violet" "_")))
(dolist (tag (mapcar #'car (subseq org-tag-alist start end)))
(push `(,tag . (:foreground ,fg-name)) org-tag-faces)))
(nd/add-tag-face "PaleGreen" 1 5) (add-hook 'org-mode-hook 'nd/set-org-tag-alist-and-faces)
(nd/add-tag-face "SkyBlue" 6 8)
(nd/add-tag-face "PaleGoldenrod" 8 10)
(nd/add-tag-face "violet" 11 19)
(add-to-list 'org-default-properties "PARENT_TYPE") (add-to-list 'org-default-properties "PARENT_TYPE")
(add-to-list 'org-default-properties "OWNER") (add-to-list 'org-default-properties "OWNER")
(setq org-global-properties (setq org-global-properties
'(("PARENT_TYPE_ALL" . "periodical iterator") '(("PARENT_TYPE_ALL" . "periodical iterator")
("Effort_ALL" . "00 10 30 60 90"))) ("Effort_ALL" . "0:05 0:15 0:30 1:00 1:30 2:00 3:00 4:00 5:00 6:00")))
;; TODO this may not be needed ;; TODO this may not be needed
(setq org-use-property-inheritance '("PARENT_TYPE")) (setq org-use-property-inheritance '("PARENT_TYPE"))
@ -330,7 +365,7 @@ to which the faces are applied"
(setq org-capture-templates (setq org-capture-templates
'(("t" "todo" entry (file "~/Org/capture.org") "* TODO %?\ndeliverable: \n%U\n") '(("t" "todo" entry (file "~/Org/capture.org") "* TODO %?\ndeliverable: \n%U\n")
("n" "note" entry (file "~/Org/capture.org") "* %? :\\%note:\n%U\n" ) ("n" "note" entry (file "~/Org/capture.org") "* %? :\\%note:\n%U\n" )
("a" "appointment" entry (file "~/Org/capture.org") "* TODO %?\n%U\n%^t\n" ) ("a" "appointment" entry (file "~/Org/capture.org") "* %?\n%U\n%^t\n" )
("m" "multi-day" entry (file "~/Org/capture.org") "* TODO %?\n%U\n%^t--%^t\n" ) ("m" "multi-day" entry (file "~/Org/capture.org") "* TODO %?\n%U\n%^t--%^t\n" )
("d" "deadline" entry (file "~/Org/capture.org") "* TODO %?\nDEADLINE: %^t\ndeliverable:\n%U\n" ) ("d" "deadline" entry (file "~/Org/capture.org") "* TODO %?\nDEADLINE: %^t\ndeliverable:\n%U\n" )
@ -423,6 +458,9 @@ If the future flag is set, returns timestamp if it is in the future
(defun nd/is-task-p () (defun nd/is-task-p ()
(and (not (nd/heading-has-children 'nd/is-todoitem-p)) (nd/is-todoitem-p))) (and (not (nd/heading-has-children 'nd/is-todoitem-p)) (nd/is-todoitem-p)))
(defun nd/is-project-task-p ()
(and (nd/heading-has-parent 'nd/is-todoitem-p) (nd/is-task-p)))
(defun nd/is-atomic-task-p () (defun nd/is-atomic-task-p ()
(and (not (nd/heading-has-parent 'nd/is-todoitem-p)) (nd/is-task-p))) (and (not (nd/heading-has-parent 'nd/is-todoitem-p)) (nd/is-task-p)))
@ -432,6 +470,14 @@ If the future flag is set, returns timestamp if it is in the future
(defun nd/is-iterator-heading-p () (defun nd/is-iterator-heading-p ()
(equal "iterator" (org-entry-get nil "PARENT_TYPE" t))) (equal "iterator" (org-entry-get nil "PARENT_TYPE" t)))
(defun nd/heading-has-effort-p ()
(org-entry-get nil "Effort"))
(defun nd/heading-has-context-p ()
(let ((tags (org-get-tags-at)))
(or (> (length (nd/filter-tags-prefix "#" tags)) 0)
(> (length (nd/filter-tags-prefix "@" tags)) 0))))
(defun nd/heading-has-children (heading-test) (defun nd/heading-has-children (heading-test)
"returns t if heading has subheadings that return t when assessed with "returns t if heading has subheadings that return t when assessed with
heading-test function" heading-test function"
@ -615,7 +661,6 @@ Note that this assumes the headline being tested is a valid project"
(t (if (not (member statuscode nd/project-statuscodes)) (t (if (not (member statuscode nd/project-statuscodes))
(error "unknown statuscode"))))) (error "unknown statuscode")))))
;; helper functions
(defun nd/skip-heading () (defun nd/skip-heading ()
(save-excursion (or (outline-next-heading) (point-max)))) (save-excursion (or (outline-next-heading) (point-max))))
@ -642,15 +687,6 @@ test-fun return true"
(if (not (and keyword ,test-fun)) (if (not (and keyword ,test-fun))
(nd/skip-heading))))) (nd/skip-heading)))))
;; stale headings
;; For archiving headings with old timestamps
;; Note that these are not always todo items
;; I only care about those that are not part
;; of projects (projects will get taken care
;; of when the entire project is finished)
;; and those that are not DONE/CANC (as
;; those appear in the regular archive
;; section)
(defun nd/skip-non-stale-headings () (defun nd/skip-non-stale-headings ()
(save-restriction (save-restriction
(widen) (widen)
@ -662,17 +698,13 @@ test-fun return true"
(not (nd/heading-has-parent 'nd/is-todoitem-p)))) (not (nd/heading-has-parent 'nd/is-todoitem-p))))
(nd/skip-heading))))) (nd/skip-heading)))))
;; atomic tasks ;; NOTE: this assumes that tags-todo will
;; by definition these have no parents, so ;; filter out all done state tasks
;; we don't need to worry about skipping over projects (defun nd/skip-non-atomic-tasks ()
;; any todo state is valid and we only sort by done/canc (save-excursion
(defun nd/skip-non-unclosed-atomic-tasks () (widen)
(nd/skip-heading-with (if (not (nd/is-atomic-task-p))
nd/is-atomic-task-p (nd/skip-heading))))
(and (not (nd/is-timestamped-heading-p))
(not (nd/is-scheduled-heading-p))
(not (nd/is-deadlined-heading-p))
(not (member keyword org-done-keywords)))))
(defun nd/skip-non-closed-atomic-tasks () (defun nd/skip-non-closed-atomic-tasks ()
(nd/skip-heading-with (nd/skip-heading-with
@ -686,34 +718,31 @@ test-fun return true"
(and (member keyword org-done-keywords) (and (member keyword org-done-keywords)
(nd/is-archivable-heading-p)))) (nd/is-archivable-heading-p))))
;; periodicals
;; these are headers marked with PARENT_TYPE=periodical
;; property that have timestamped headers as children
;; which in turn may or may not have todo keywords.
;; They are to be refilled when all children are stale
;; Note that I only care about the parent headers
;; as the children should always show up in the agenda
;; simply because they have timestamps. Parents can be
;; either fresh (at least one child in the future) or
;; stale (all children in the past)
(defun nd/skip-non-fresh-periodical-parent-headers () (defun nd/skip-non-fresh-periodical-parent-headers ()
(save-restriction (save-restriction
(widen) (widen)
(if (and (nd/is-periodical-p) (if (not (and (nd/is-periodical-heading-p)
(not (nd/header-has-parent 'nd/is-periodical-p)) (not (nd/heading-has-parent 'nd/is-periodical-heading-p))
(nd/header-has-children 'nd/is-fresh-heading-p)) (nd/heading-has-children 'nd/is-fresh-heading-p)))
(nd/skip-heading))))
(defun nd/skip-non-stale-periodical-parent-headers ()
(save-restriction
(widen)
(if (not (and (nd/is-periodical-heading-p)
(not (nd/heading-has-parent 'nd/is-periodical-heading-p))
(nd/heading-has-children 'nd/is-stale-heading-p)
(not (nd/heading-has-children 'nd/is-fresh-heading-p))))
(nd/skip-heading))))
(defun nd/skip-non-empty-periodical-parent-headers ()
(save-restriction
(widen)
(if (not (and (nd/is-periodical-heading-p)
(not (nd/heading-has-parent 'nd/is-periodical-heading-p))
(not (nd/heading-has-children 'nd/is-timestamped-heading-p))))
(nd/skip-heading)))) (nd/skip-heading))))
;; project tasks
;; since these are part of projects I need to assess
;; if the parent project is skippable, in which case
;; I jump to the next subtree
;; Note that I only care about the keyword in these
;; cases because I don't archive these, I archive
;; their parent projects. The keywords I care about
;; are NEXT, WAIT, and HOLD because these are
;; definitive project tasks that require/inhibit
;; futher action
(defun nd/skip-non-keyword-project-tasks (skip-keyword) (defun nd/skip-non-keyword-project-tasks (skip-keyword)
(save-restriction (save-restriction
(widen) (widen)
@ -731,7 +760,6 @@ test-fun return true"
(nd/skip-heading))) (nd/skip-heading)))
(nd/skip-heading))))) (nd/skip-heading)))))
;; header-level errors
(defun nd/skip-non-discontinuous-project-tasks () (defun nd/skip-non-discontinuous-project-tasks ()
(nd/skip-heading-with (nd/skip-heading-with
nd/is-todoitem-p nd/is-todoitem-p
@ -749,19 +777,31 @@ test-fun return true"
(and (not (member keyword org-done-keywords)) (and (not (member keyword org-done-keywords))
(nd/is-closed-heading-p)))) (nd/is-closed-heading-p))))
(defun nd/skip-non-untimestamped-periodical-headers ()
(save-restriction
(widen)
(if (not (and (nd/is-periodical-p)
(not (nd/is-timestamped-heading-p))))
(nd/skip-heading))))
(defun nd/skip-non-iterator-atomic-tasks () (defun nd/skip-non-iterator-atomic-tasks ()
(nd/skip-heading-with (nd/skip-heading-with
nd/is-atomic-task-p nd/is-atomic-task-p
(nd/is-iterator-heading-p))) (nd/is-iterator-heading-p)))
;; projects (defun nd/skip-atomic-tasks-with-context ()
(nd/skip-heading-with
nd/is-atomic-task-p
(not (nd/heading-has-context-p))))
(defun nd/skip-project-tasks-with-context ()
(nd/skip-heading-with
nd/is-project-task-p
(not (nd/heading-has-context-p))))
(defun nd/skip-projects-with-context ()
(nd/skip-heading-with
nd/is-project-p
(not (nd/heading-has-context-p))))
(defun nd/skip-tasks-with-effort ()
(nd/skip-heading-with
nd/is-task-p
(not (nd/heading-has-effort-p))))
(defun nd/skip-projects-without-statuscode (statuscode) (defun nd/skip-projects-without-statuscode (statuscode)
(save-restriction (save-restriction
(widen) (widen)
@ -777,6 +817,9 @@ test-fun return true"
(defvar nd/agenda-limit-project-toplevel t (defvar nd/agenda-limit-project-toplevel t
"used to filter projects by all levels or top-level only") "used to filter projects by all levels or top-level only")
(defvar nd/agenda-hide-incubator-tags t
"used to filter incubator headings")
(defun nd/toggle-project-toplevel-display () (defun nd/toggle-project-toplevel-display ()
(interactive) (interactive)
(setq nd/agenda-limit-project-toplevel (not nd/agenda-limit-project-toplevel)) (setq nd/agenda-limit-project-toplevel (not nd/agenda-limit-project-toplevel))
@ -785,79 +828,102 @@ test-fun return true"
(message "Showing %s project view in agenda" (message "Showing %s project view in agenda"
(if nd/agenda-limit-project-toplevel "toplevel" "complete"))) (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))
(setq org-agenda-tags-todo-honor-ignore-options t) (setq org-agenda-tags-todo-honor-ignore-options t)
(setq org-agenda-prefix-format (setq org-agenda-prefix-format
'((agenda . " %-12:c%-5:e%?-12t% s") '((agenda . " %-12:c%-7:e%?-12t% s")
(timeline . " % s") (timeline . " % s")
(todo . " %-12:c") (todo . " %-12:c")
(tags . " %-12:c%-5:e") (tags . " %-12:c%-7:e")
(search . " %-12:c"))) (search . " %-12:c")))
(defun nd/agenda-base-task-command (match keyword skip-fun) (defun nd/agenda-base-header-command (match header skip-fun)
"shorter syntax to define task agenda commands"
`(tags `(tags
,match ,match
((org-agenda-overriding-header (concat ,keyword " Tasks")) ((org-agenda-overriding-header ,header)
(org-agenda-skip-function ,skip-fun) (org-agenda-skip-function ,skip-fun)
(org-agenda-sorting-strategy '(category-keep))))) (org-agenda-sorting-strategy '(category-keep)))))
(defun nd/agenda-base-project-command (match keyword statuscode) (defun nd/agenda-base-task-command (match header skip-fun)
"shorter syntax to define project agenda commands" `(tags-todo
,match
((org-agenda-overriding-header ,header)
(org-agenda-skip-function ,skip-fun)
(org-agenda-todo-ignore-with-date t)
(org-agenda-sorting-strategy '(category-keep)))))
(defun nd/agenda-base-project-command (match header statuscode)
`(tags `(tags
,match ,match
((org-agenda-overriding-header ((org-agenda-overriding-header
(concat (and nd/agenda-limit-project-toplevel "Toplevel ") ,keyword " Projects")) (concat (and nd/agenda-limit-project-toplevel "Toplevel ") ,header))
(org-agenda-skip-function '(nd/skip-projects-without-statuscode ,statuscode)) (org-agenda-skip-function '(nd/skip-projects-without-statuscode ,statuscode))
(org-agenda-sorting-strategy '(category-keep))))) (org-agenda-sorting-strategy '(category-keep)))))
(let ((task-view-match "-NA-REFILE") (setq org-agenda-tag-filter-preset (list "-%inc"))
(project-view-match "-NA-REFILE-PARENT_TYPE=\"iterator\"/")
(series-view-match "-NA-REFILE+PARENT_TYPE=\"iterator\"/")) (let ((task-match "-NA-REFILE-PARENT_TYPE=\"periodical\"/")
(project-match "-NA-REFILE-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\"/"))
(setq org-agenda-custom-commands (setq org-agenda-custom-commands
`(("t" `(("t"
"Task View" "Task View"
((agenda "" nil) ((agenda "" nil)
,(nd/agenda-base-task-command task-view-match "Next Project" ''(nd/skip-non-keyword-project-tasks "NEXT")) ,(nd/agenda-base-task-command task-match "Next Project Tasks" ''(nd/skip-non-keyword-project-tasks "NEXT"))
,(nd/agenda-base-task-command task-view-match "Waiting Project" ''(nd/skip-non-keyword-project-tasks "WAIT")) ,(nd/agenda-base-task-command task-match "Waiting Project Tasks" ''(nd/skip-non-keyword-project-tasks "WAIT"))
,(nd/agenda-base-task-command task-view-match "Atomic" ''nd/skip-non-unclosed-atomic-tasks) ,(nd/agenda-base-task-command project-match "Atomic Tasks" ''nd/skip-non-atomic-tasks)
,(nd/agenda-base-task-command task-view-match "Held Project" ''(nd/skip-non-keyword-project-tasks "HOLD")))) ,(nd/agenda-base-task-command task-match "Held Project Tasks" ''(nd/skip-non-keyword-project-tasks "HOLD"))))
("p" ("p"
"Project View" "Project View"
(,(nd/agenda-base-project-command project-view-match "Stuck" :stuck) (,(nd/agenda-base-project-command project-match "Stuck Projects" :stuck)
,(nd/agenda-base-project-command project-view-match "Waiting" :waiting) ,(nd/agenda-base-project-command project-match "Waiting Projects" :waiting)
,(nd/agenda-base-project-command project-view-match "Active" :active) ,(nd/agenda-base-project-command project-match "Active Projects" :active)
,(nd/agenda-base-project-command project-view-match "Held" :held))) ,(nd/agenda-base-project-command project-match "Held Projects" :held)))
("s" ("P"
"Series View" "Periodical View"
(,(nd/agenda-base-project-command series-view-match "Stuck Series" :stuck) (,(nd/agenda-base-header-command periodical-match "Empty Periodicals" ''nd/skip-non-empty-periodical-parent-headers)
,(nd/agenda-base-project-command series-view-match "Empty Series" :undone-complete) ,(nd/agenda-base-header-command periodical-match "Stale Periodicals" ''nd/skip-non-stale-periodical-parent-headers)
,(nd/agenda-base-project-command series-view-match "Active Series" :active) ,(nd/agenda-base-header-command periodical-match "Fresh Periodicals" ''nd/skip-non-fresh-periodical-parent-headers)))
,(nd/agenda-base-project-command series-view-match "Waiting Series" :waiting) ("i"
,(nd/agenda-base-project-command series-view-match "Held Series" :held) "Iterator View"
,(nd/agenda-base-task-command series-view-match "Uninitialized Series" ''nd/skip-non-iterator-atomic-tasks))) (,(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)))
("r" ("r"
"Refile and Critical Errors" "Refile and Critical Errors"
((tags "REFILE" ((tags "REFILE"
((org-agenda-overriding-header "Tasks to Refile")) ((org-agenda-overriding-header "Tasks to Refile"))
(org-tags-match-list-sublevels nil)) (org-tags-match-list-sublevels nil))
,(nd/agenda-base-task-command task-view-match "Discontinous Project" ''nd/skip-non-discontinuous-project-tasks) ,(nd/agenda-base-task-command "-NA-REFILE/TODO|NEXT|WAIT" "Project Tasks Without Context" ''nd/skip-project-tasks-with-context)
,(nd/agenda-base-project-command project-view-match "Invalid Todostate" :invalid-todostate))) ,(nd/agenda-base-task-command "-NA-REFILE/!" "Atomic Tasks Without Context" ''nd/skip-atomic-tasks-with-context)
;; ,(nd/agenda-base-task-command "-NA-REFILE-%subdiv/TODO|NEXT|WAIT" "Tasks Without Effort" ''nd/skip-tasks-with-effort)
,(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)))
("e" ("e"
"Non-critical Errors" "Non-critical Errors"
(,(nd/agenda-base-task-command task-view-match "Undone Closed" ''nd/skip-non-undone-closed-todoitems) (,(nd/agenda-base-header-command task-match "Undone Closed" ''nd/skip-non-undone-closed-todoitems)
,(nd/agenda-base-task-command task-view-match "Done Unclosed" ''nd/skip-non-done-unclosed-todoitems) ,(nd/agenda-base-header-command task-match "Done Unclosed" ''nd/skip-non-done-unclosed-todoitems)
,(nd/agenda-base-project-command project-view-match "Undone Completed" :undone-complete) ,(nd/agenda-base-project-command project-match "Undone Completed" :undone-complete)
,(nd/agenda-base-project-command project-view-match "Done Incompleted" :done-incomplete))) ,(nd/agenda-base-project-command project-match "Done Incompleted" :done-incomplete)))
("A" ("A"
"Archivable Tasks and Projects" "Archivable Tasks and Projects"
(,(nd/agenda-base-task-command task-view-match "Archivable Atomic" ''nd/skip-non-archivable-atomic-tasks) (,(nd/agenda-base-header-command task-match "Archivable Atomic Tasks" ''nd/skip-non-archivable-atomic-tasks)
,(nd/agenda-base-task-command task-view-match "Stale" ''nd/skip-non-stale-headings) ,(nd/agenda-base-header-command task-match "Stale Tasks" ''nd/skip-non-stale-headings)
,(nd/agenda-base-project-command series-view-match "Archivable Series" :archivable) ,(nd/agenda-base-project-command iterator-match "Archivable Iterators" :archivable)
,(nd/agenda-base-project-command project-view-match "Archivable" :archivable)))))) ,(nd/agenda-base-project-command project-match "Archivable Projects" :archivable))))))
(evil-define-key 'motion org-agenda-mode-map "T" 'nd/toggle-project-toplevel-display)
(setq org-agenda-start-on-weekday 1)
(setq org-agenda-span 'day) (setq org-agenda-span 'day)
(setq org-agenda-time-grid (quote ((daily today remove-match) (setq org-agenda-time-grid (quote ((daily today remove-match)
#("----------------" 0 16 (org-heading t)) #("----------------" 0 16 (org-heading t))
@ -879,7 +945,7 @@ test-fun return true"
(setq org-agenda-auto-exclude-function 'nd/org-auto-exclude-function) (setq org-agenda-auto-exclude-function 'nd/org-auto-exclude-function)
(setq org-columns-default-format (setq org-columns-default-format
"%25ITEM %4TODO %TAGS %3Effort{+} %OWNER(OWN)") "%25ITEM %4TODO %TAGS %5Effort{:} %OWNER(OWN)")
(set-face-attribute 'org-column nil :background "#1e2023") (set-face-attribute 'org-column nil :background "#1e2023")
;; org-columns-summary-types ;; org-columns-summary-types

353
conf.org
View File

@ -98,7 +98,8 @@ NOTE: this only works if we start term after gui, and term has light bg. not big
:ensure t :ensure t
:config :config
(dashboard-setup-startup-hook) (dashboard-setup-startup-hook)
(setq dashboard-items '((recents . 10)))) (setq dashboard-banner-logo-title "Emacs"))
;; (setq dashboard-items '((recents . 10))))
#+END_SRC #+END_SRC
* keybindings * keybindings
** overrides ** overrides
@ -175,7 +176,8 @@ These are commands that should work in any mode. Make the assumption that functi
:ensure t :ensure t
:delight :delight
:init :init
(add-hook 'prog-mode-hook #'rainbow-delimiters-mode)) (add-hook 'prog-mode-hook #'rainbow-delimiters-mode)
(add-hook 'ess-mode-hook #'rainbow-delimiters-mode))
#+END_SRC #+END_SRC
** ace-window ** ace-window
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -414,6 +416,22 @@ the fonts in org headings bug me, make them smaller and less invasive
(local-set-key (kbd "C-c C-x x") 'nd/mark-subtree-done) (local-set-key (kbd "C-c C-x x") 'nd/mark-subtree-done)
(local-set-key (kbd "C-c C-x c") 'nd/org-clone-subtree-with-time-shift-reset))) (local-set-key (kbd "C-c C-x c") 'nd/org-clone-subtree-with-time-shift-reset)))
#+END_SRC #+END_SRC
*** agenda
#+BEGIN_SRC emacs-lisp
(evil-define-key 'motion org-agenda-mode-map
"t" 'nd/toggle-project-toplevel-display
"D" 'org-agenda-day-view
"W" 'org-agenda-week-view
"M" 'org-agenda-month-view
"Y" 'org-agenda-year-view
"ct" nil
"e" 'org-agenda-set-effort
"ce" nil)
(add-hook 'org-agenda-mode-hook
(lambda ()
(local-set-key (kbd "C-c C-c") '(message org-tags-alist))))
#+END_SRC
** todo states ** todo states
*** sequences *** sequences
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -439,21 +457,46 @@ Any tag that is not part of these groups (eg some filetags in the few cases I us
There are several types of tags I use: There are several types of tags I use:
- location: a GTD contexts; these start with "@" - location: a GTD contexts; these start with "@"
- tools: also a GTD contexts; these start with "#" - tools: also a GTD contexts; these start with "#"
- attribute: useful flags for filtering; these start with "%" - attribute: useful flags for filtering; these start with "."
- life areas: key areas of life which define priorities and goals; these start with "_" - life areas: key areas of life which define priorities and goals; these start with "_"
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq org-tag-alist '((:startgroup) (defun nd/filter-tags-prefix (prefix tags-list)
"Return a subset of tags-list whose first character matches prefix.'
tags-list defaults to org-tag-alist if not given"
(seq-filter (lambda (tag)
(and (stringp tag)
(string-prefix-p prefix tag)))
tags-list))
(defun nd/add-tag-face (fg-name prefix)
"Adds list of cons cells to org-tag-faces with foreground set to fg-name.
Start and end specify the positions in org-tag-alist which define the tags
to which the faces are applied"
(dolist (tag (nd/filter-tags-prefix prefix (mapcar #'car org-tag-alist)))
(push `(,tag . (:foreground ,fg-name)) org-tag-faces)))
;; for some reason, org-mode doesn't like it if the org-tags-alist
;; has special chars before it is loaded (overrides keybindings)
;; this somewhat convoluted hook works tho...
(defun nd/set-org-tag-alist-and-faces ()
(progn
;; dirty hack to keep org agenda happy
;; (setq org-tag-alist '((:newline)))
(setq org-tag-alist
'((:startgroup)
("@errand" . ?e) ("@errand" . ?e)
("@work" . ?w)
("@home" . ?h) ("@home" . ?h)
("@work" . ?w)
("@travel" . ?t) ("@travel" . ?t)
(:endgroup) (:endgroup)
("#laptop" . ?L) ("#laptop" . ?L)
("#tcult" . ?T) ("#tcult" . ?T)
("#phone" . ?O)
("%note" . ?n) ("$note" . ?n)
("%subdiv" . ?s) ("$inc" . ?i)
("$subdiv" . ?s)
(:startgroup) (:startgroup)
("_env" . ?E) ("_env" . ?E)
@ -466,20 +509,14 @@ There are several types of tags I use:
("_soc" . ?S) ("_soc" . ?S)
(:endgroup))) (:endgroup)))
;; not the most elegant but this will work
(setq org-tag-faces '()) (setq org-tag-faces '())
(defun nd/add-tag-face (fg-name start end) (nd/add-tag-face "PaleGreen" "@")
"Adds list of cons cells to org-tag-faces with foreground set to fg-name. (nd/add-tag-face "SkyBlue" "#")
Start and end specify the positions in org-tag-alist which define the tags (nd/add-tag-face "PaleGoldenrod" "$")
to which the faces are applied" (nd/add-tag-face "violet" "_")))
(dolist (tag (mapcar #'car (subseq org-tag-alist start end)))
(push `(,tag . (:foreground ,fg-name)) org-tag-faces)))
(nd/add-tag-face "PaleGreen" 1 5) (add-hook 'org-mode-hook 'nd/set-org-tag-alist-and-faces)
(nd/add-tag-face "SkyBlue" 6 8)
(nd/add-tag-face "PaleGoldenrod" 8 10)
(nd/add-tag-face "violet" 11 19)
#+END_SRC #+END_SRC
** properties ** properties
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -487,17 +524,17 @@ There are several types of tags I use:
(add-to-list 'org-default-properties "OWNER") (add-to-list 'org-default-properties "OWNER")
(setq org-global-properties (setq org-global-properties
'(("PARENT_TYPE_ALL" . "periodical iterator") '(("PARENT_TYPE_ALL" . "periodical iterator")
("Effort_ALL" . "00 10 30 60 90"))) ("Effort_ALL" . "0:05 0:15 0:30 1:00 1:30 2:00 3:00 4:00 5:00 6:00")))
;; TODO this may not be needed ;; TODO this may not be needed
(setq org-use-property-inheritance '("PARENT_TYPE")) (setq org-use-property-inheritance '("PARENT_TYPE"))
#+END_SRC #+END_SRC
** capture templates ** capture
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq org-capture-templates (setq org-capture-templates
'(("t" "todo" entry (file "~/Org/capture.org") "* TODO %?\ndeliverable: \n%U\n") '(("t" "todo" entry (file "~/Org/capture.org") "* TODO %?\ndeliverable: \n%U\n")
("n" "note" entry (file "~/Org/capture.org") "* %? :\\%note:\n%U\n" ) ("n" "note" entry (file "~/Org/capture.org") "* %? :\\%note:\n%U\n" )
("a" "appointment" entry (file "~/Org/capture.org") "* TODO %?\n%U\n%^t\n" ) ("a" "appointment" entry (file "~/Org/capture.org") "* %?\n%U\n%^t\n" )
("m" "multi-day" entry (file "~/Org/capture.org") "* TODO %?\n%U\n%^t--%^t\n" ) ("m" "multi-day" entry (file "~/Org/capture.org") "* TODO %?\n%U\n%^t--%^t\n" )
("d" "deadline" entry (file "~/Org/capture.org") "* TODO %?\nDEADLINE: %^t\ndeliverable:\n%U\n" ) ("d" "deadline" entry (file "~/Org/capture.org") "* TODO %?\nDEADLINE: %^t\ndeliverable:\n%U\n" )
@ -613,6 +650,9 @@ Doubles as a way to further test the todostate in downstream functions
(defun nd/is-task-p () (defun nd/is-task-p ()
(and (not (nd/heading-has-children 'nd/is-todoitem-p)) (nd/is-todoitem-p))) (and (not (nd/heading-has-children 'nd/is-todoitem-p)) (nd/is-todoitem-p)))
(defun nd/is-project-task-p ()
(and (nd/heading-has-parent 'nd/is-todoitem-p) (nd/is-task-p)))
(defun nd/is-atomic-task-p () (defun nd/is-atomic-task-p ()
(and (not (nd/heading-has-parent 'nd/is-todoitem-p)) (nd/is-task-p))) (and (not (nd/heading-has-parent 'nd/is-todoitem-p)) (nd/is-task-p)))
#+END_SRC #+END_SRC
@ -624,6 +664,14 @@ Returns t is heading matches a certian set of properties
(defun nd/is-iterator-heading-p () (defun nd/is-iterator-heading-p ()
(equal "iterator" (org-entry-get nil "PARENT_TYPE" t))) (equal "iterator" (org-entry-get nil "PARENT_TYPE" t)))
(defun nd/heading-has-effort-p ()
(org-entry-get nil "Effort"))
(defun nd/heading-has-context-p ()
(let ((tags (org-get-tags-at)))
(or (> (length (nd/filter-tags-prefix "#" tags)) 0)
(> (length (nd/filter-tags-prefix "@" tags)) 0))))
#+END_SRC #+END_SRC
**** relational testing **** relational testing
Returns t if heading has certain relationship to other headings Returns t if heading has certain relationship to other headings
@ -816,8 +864,9 @@ Returns t if heading has certain relationship to other headings
*** skip functions *** skip functions
These are the primary means we use to sort through tasks. Note that we could do this with These are the primary means we use to sort through tasks. Note that we could do this with
tags in the custom commands section but I find this easier to maintain and possibly faster. tags in the custom commands section but I find this easier to maintain and possibly faster.
**** helper skip functions and macros
Subunits for skip functions. Not meant to be used or called from the custom commands api
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
;; helper functions
(defun nd/skip-heading () (defun nd/skip-heading ()
(save-excursion (or (outline-next-heading) (point-max)))) (save-excursion (or (outline-next-heading) (point-max))))
@ -843,16 +892,18 @@ tags in the custom commands section but I find this easier to maintain and possi
(message keyword) (message keyword)
(if (not (and keyword ,test-fun)) (if (not (and keyword ,test-fun))
(nd/skip-heading))))) (nd/skip-heading)))))
#+END_SRC
**** stale headings
For archiving headings with old timestamps
;; stale headings Note that these are not always todo items
;; For archiving headings with old timestamps I only care about those that are not part
;; Note that these are not always todo items of projects (projects will get taken care
;; I only care about those that are not part of when the entire project is finished)
;; of projects (projects will get taken care and those that are not DONE/CANC (as
;; of when the entire project is finished) those appear in the regular archive
;; and those that are not DONE/CANC (as section)
;; those appear in the regular archive #+BEGIN_SRC emacs-lisp
;; section)
(defun nd/skip-non-stale-headings () (defun nd/skip-non-stale-headings ()
(save-restriction (save-restriction
(widen) (widen)
@ -864,17 +915,19 @@ tags in the custom commands section but I find this easier to maintain and possi
(not (nd/heading-has-parent 'nd/is-todoitem-p)))) (not (nd/heading-has-parent 'nd/is-todoitem-p))))
(nd/skip-heading))))) (nd/skip-heading)))))
;; atomic tasks #+END_SRC
;; by definition these have no parents, so **** atomic tasks
;; we don't need to worry about skipping over projects By definition these have no parents, so
;; any todo state is valid and we only sort by done/canc I don't need to worry about skipping over projects
(defun nd/skip-non-unclosed-atomic-tasks () any todo state is valid and we only sort by done/canc
(nd/skip-heading-with #+BEGIN_SRC emacs-lisp
nd/is-atomic-task-p ;; NOTE: this assumes that tags-todo will
(and (not (nd/is-timestamped-heading-p)) ;; filter out all done state tasks
(not (nd/is-scheduled-heading-p)) (defun nd/skip-non-atomic-tasks ()
(not (nd/is-deadlined-heading-p)) (save-excursion
(not (member keyword org-done-keywords))))) (widen)
(if (not (nd/is-atomic-task-p))
(nd/skip-heading))))
(defun nd/skip-non-closed-atomic-tasks () (defun nd/skip-non-closed-atomic-tasks ()
(nd/skip-heading-with (nd/skip-heading-with
@ -887,35 +940,56 @@ tags in the custom commands section but I find this easier to maintain and possi
nd/is-atomic-task-p nd/is-atomic-task-p
(and (member keyword org-done-keywords) (and (member keyword org-done-keywords)
(nd/is-archivable-heading-p)))) (nd/is-archivable-heading-p))))
#+END_SRC
;; periodicals **** periodicals
;; these are headers marked with PARENT_TYPE=periodical These are headers marked with PARENT_TYPE=periodical
;; property that have timestamped headers as children property that have timestamped headers as children
;; which in turn may or may not have todo keywords. which in turn may or may not have todo keywords.
;; They are to be refilled when all children are stale They are to be refilled when all children are stale
;; Note that I only care about the parent headers Note that I only care about the parent headers
;; as the children should always show up in the agenda as the children should always show up in the agenda
;; simply because they have timestamps. Parents can be simply because they have timestamps. Parents can be
;; either fresh (at least one child in the future) or either fresh (at least one child in the future) or
;; stale (all children in the past) stale (all children in the past).
#+BEGIN_SRC emacs-lisp
(defun nd/skip-non-fresh-periodical-parent-headers () (defun nd/skip-non-fresh-periodical-parent-headers ()
(save-restriction (save-restriction
(widen) (widen)
(if (and (nd/is-periodical-p) (if (not (and (nd/is-periodical-heading-p)
(not (nd/header-has-parent 'nd/is-periodical-p)) (not (nd/heading-has-parent 'nd/is-periodical-heading-p))
(nd/header-has-children 'nd/is-fresh-heading-p)) (nd/heading-has-children 'nd/is-fresh-heading-p)))
(nd/skip-heading)))) (nd/skip-heading))))
;; project tasks (defun nd/skip-non-stale-periodical-parent-headers ()
;; since these are part of projects I need to assess (save-restriction
;; if the parent project is skippable, in which case (widen)
;; I jump to the next subtree (if (not (and (nd/is-periodical-heading-p)
;; Note that I only care about the keyword in these (not (nd/heading-has-parent 'nd/is-periodical-heading-p))
;; cases because I don't archive these, I archive (nd/heading-has-children 'nd/is-stale-heading-p)
;; their parent projects. The keywords I care about (not (nd/heading-has-children 'nd/is-fresh-heading-p))))
;; are NEXT, WAIT, and HOLD because these are (nd/skip-heading))))
;; definitive project tasks that require/inhibit
;; futher action (defun nd/skip-non-empty-periodical-parent-headers ()
(save-restriction
(widen)
(if (not (and (nd/is-periodical-heading-p)
(not (nd/heading-has-parent 'nd/is-periodical-heading-p))
(not (nd/heading-has-children 'nd/is-timestamped-heading-p))))
(nd/skip-heading))))
#+END_SRC
**** project tasks
Since these are part of projects I need to assess
if the parent project is skippable, in which case
I jump to the next subtree
Note that I only care about the keyword in these
cases because I don't archive these, I archive
their parent projects. The keywords I care about
are NEXT, WAIT, and HOLD because these are
definitive project tasks that require/inhibit
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-keyword-project-tasks (skip-keyword) (defun nd/skip-non-keyword-project-tasks (skip-keyword)
(save-restriction (save-restriction
(widen) (widen)
@ -933,7 +1007,11 @@ tags in the custom commands section but I find this easier to maintain and possi
(nd/skip-heading))) (nd/skip-heading)))
(nd/skip-heading))))) (nd/skip-heading)))))
;; header-level errors #+END_SRC
**** header-level errors
Some headers are invalid under certain conditions
which I test here
#+BEGIN_SRC emacs-lisp
(defun nd/skip-non-discontinuous-project-tasks () (defun nd/skip-non-discontinuous-project-tasks ()
(nd/skip-heading-with (nd/skip-heading-with
nd/is-todoitem-p nd/is-todoitem-p
@ -951,19 +1029,36 @@ tags in the custom commands section but I find this easier to maintain and possi
(and (not (member keyword org-done-keywords)) (and (not (member keyword org-done-keywords))
(nd/is-closed-heading-p)))) (nd/is-closed-heading-p))))
(defun nd/skip-non-untimestamped-periodical-headers ()
(save-restriction
(widen)
(if (not (and (nd/is-periodical-p)
(not (nd/is-timestamped-heading-p))))
(nd/skip-heading))))
(defun nd/skip-non-iterator-atomic-tasks () (defun nd/skip-non-iterator-atomic-tasks ()
(nd/skip-heading-with (nd/skip-heading-with
nd/is-atomic-task-p nd/is-atomic-task-p
(nd/is-iterator-heading-p))) (nd/is-iterator-heading-p)))
;; projects (defun nd/skip-atomic-tasks-with-context ()
(nd/skip-heading-with
nd/is-atomic-task-p
(not (nd/heading-has-context-p))))
(defun nd/skip-project-tasks-with-context ()
(nd/skip-heading-with
nd/is-project-task-p
(not (nd/heading-has-context-p))))
(defun nd/skip-projects-with-context ()
(nd/skip-heading-with
nd/is-project-p
(not (nd/heading-has-context-p))))
(defun nd/skip-tasks-with-effort ()
(nd/skip-heading-with
nd/is-task-p
(not (nd/heading-has-effort-p))))
#+END_SRC
**** projects
Projects are handled quite simply. They have statuscodes
for which I test, and this can all be handled by one function.
Note that this is used for "normal" projects as well as iterators
#+BEGIN_SRC emacs-lisp
(defun nd/skip-projects-without-statuscode (statuscode) (defun nd/skip-projects-without-statuscode (statuscode)
(save-restriction (save-restriction
(widen) (widen)
@ -981,6 +1076,9 @@ tags in the custom commands section but I find this easier to maintain and possi
(defvar nd/agenda-limit-project-toplevel t (defvar nd/agenda-limit-project-toplevel t
"used to filter projects by all levels or top-level only") "used to filter projects by all levels or top-level only")
(defvar nd/agenda-hide-incubator-tags t
"used to filter incubator headings")
(defun nd/toggle-project-toplevel-display () (defun nd/toggle-project-toplevel-display ()
(interactive) (interactive)
(setq nd/agenda-limit-project-toplevel (not nd/agenda-limit-project-toplevel)) (setq nd/agenda-limit-project-toplevel (not nd/agenda-limit-project-toplevel))
@ -988,88 +1086,109 @@ tags in the custom commands section but I find this easier to maintain and possi
(org-agenda-redo)) (org-agenda-redo))
(message "Showing %s project view in agenda" (message "Showing %s project view in agenda"
(if nd/agenda-limit-project-toplevel "toplevel" "complete"))) (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))
#+END_SRC #+END_SRC
*** custom commands *** custom commands
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq org-agenda-tags-todo-honor-ignore-options t) (setq org-agenda-tags-todo-honor-ignore-options t)
(setq org-agenda-prefix-format (setq org-agenda-prefix-format
'((agenda . " %-12:c%-5:e%?-12t% s") '((agenda . " %-12:c%-7:e%?-12t% s")
(timeline . " % s") (timeline . " % s")
(todo . " %-12:c") (todo . " %-12:c")
(tags . " %-12:c%-5:e") (tags . " %-12:c%-7:e")
(search . " %-12:c"))) (search . " %-12:c")))
(defun nd/agenda-base-task-command (match keyword skip-fun) (defun nd/agenda-base-header-command (match header skip-fun)
"shorter syntax to define task agenda commands"
`(tags `(tags
,match ,match
((org-agenda-overriding-header (concat ,keyword " Tasks")) ((org-agenda-overriding-header ,header)
(org-agenda-skip-function ,skip-fun) (org-agenda-skip-function ,skip-fun)
(org-agenda-sorting-strategy '(category-keep))))) (org-agenda-sorting-strategy '(category-keep)))))
(defun nd/agenda-base-project-command (match keyword statuscode) (defun nd/agenda-base-task-command (match header skip-fun)
"shorter syntax to define project agenda commands" `(tags-todo
,match
((org-agenda-overriding-header ,header)
(org-agenda-skip-function ,skip-fun)
(org-agenda-todo-ignore-with-date t)
(org-agenda-sorting-strategy '(category-keep)))))
(defun nd/agenda-base-project-command (match header statuscode)
`(tags `(tags
,match ,match
((org-agenda-overriding-header ((org-agenda-overriding-header
(concat (and nd/agenda-limit-project-toplevel "Toplevel ") ,keyword " Projects")) (concat (and nd/agenda-limit-project-toplevel "Toplevel ") ,header))
(org-agenda-skip-function '(nd/skip-projects-without-statuscode ,statuscode)) (org-agenda-skip-function '(nd/skip-projects-without-statuscode ,statuscode))
(org-agenda-sorting-strategy '(category-keep))))) (org-agenda-sorting-strategy '(category-keep)))))
(let ((task-view-match "-NA-REFILE") (setq org-agenda-tag-filter-preset (list "-%inc"))
(project-view-match "-NA-REFILE-PARENT_TYPE=\"iterator\"/")
(series-view-match "-NA-REFILE+PARENT_TYPE=\"iterator\"/")) (let ((task-match "-NA-REFILE-PARENT_TYPE=\"periodical\"/")
(project-match "-NA-REFILE-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\"/"))
(setq org-agenda-custom-commands (setq org-agenda-custom-commands
`(("t" `(("t"
"Task View" "Task View"
((agenda "" nil) ((agenda "" nil)
,(nd/agenda-base-task-command task-view-match "Next Project" ''(nd/skip-non-keyword-project-tasks "NEXT")) ,(nd/agenda-base-task-command task-match "Next Project Tasks" ''(nd/skip-non-keyword-project-tasks "NEXT"))
,(nd/agenda-base-task-command task-view-match "Waiting Project" ''(nd/skip-non-keyword-project-tasks "WAIT")) ,(nd/agenda-base-task-command task-match "Waiting Project Tasks" ''(nd/skip-non-keyword-project-tasks "WAIT"))
,(nd/agenda-base-task-command task-view-match "Atomic" ''nd/skip-non-unclosed-atomic-tasks) ,(nd/agenda-base-task-command project-match "Atomic Tasks" ''nd/skip-non-atomic-tasks)
,(nd/agenda-base-task-command task-view-match "Held Project" ''(nd/skip-non-keyword-project-tasks "HOLD")))) ,(nd/agenda-base-task-command task-match "Held Project Tasks" ''(nd/skip-non-keyword-project-tasks "HOLD"))))
("p" ("p"
"Project View" "Project View"
(,(nd/agenda-base-project-command project-view-match "Stuck" :stuck) (,(nd/agenda-base-project-command project-match "Stuck Projects" :stuck)
,(nd/agenda-base-project-command project-view-match "Waiting" :waiting) ,(nd/agenda-base-project-command project-match "Waiting Projects" :waiting)
,(nd/agenda-base-project-command project-view-match "Active" :active) ,(nd/agenda-base-project-command project-match "Active Projects" :active)
,(nd/agenda-base-project-command project-view-match "Held" :held))) ,(nd/agenda-base-project-command project-match "Held Projects" :held)))
("s" ("P"
"Series View" "Periodical View"
(,(nd/agenda-base-project-command series-view-match "Stuck Series" :stuck) (,(nd/agenda-base-header-command periodical-match "Empty Periodicals" ''nd/skip-non-empty-periodical-parent-headers)
,(nd/agenda-base-project-command series-view-match "Empty Series" :undone-complete) ,(nd/agenda-base-header-command periodical-match "Stale Periodicals" ''nd/skip-non-stale-periodical-parent-headers)
,(nd/agenda-base-project-command series-view-match "Active Series" :active) ,(nd/agenda-base-header-command periodical-match "Fresh Periodicals" ''nd/skip-non-fresh-periodical-parent-headers)))
,(nd/agenda-base-project-command series-view-match "Waiting Series" :waiting) ("i"
,(nd/agenda-base-project-command series-view-match "Held Series" :held) "Iterator View"
,(nd/agenda-base-task-command series-view-match "Uninitialized Series" ''nd/skip-non-iterator-atomic-tasks))) (,(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)))
("r" ("r"
"Refile and Critical Errors" "Refile and Critical Errors"
((tags "REFILE" ((tags "REFILE"
((org-agenda-overriding-header "Tasks to Refile")) ((org-agenda-overriding-header "Tasks to Refile"))
(org-tags-match-list-sublevels nil)) (org-tags-match-list-sublevels nil))
,(nd/agenda-base-task-command task-view-match "Discontinous Project" ''nd/skip-non-discontinuous-project-tasks) ,(nd/agenda-base-task-command "-NA-REFILE/TODO|NEXT|WAIT" "Project Tasks Without Context" ''nd/skip-project-tasks-with-context)
,(nd/agenda-base-project-command project-view-match "Invalid Todostate" :invalid-todostate))) ,(nd/agenda-base-task-command "-NA-REFILE/!" "Atomic Tasks Without Context" ''nd/skip-atomic-tasks-with-context)
;; ,(nd/agenda-base-task-command "-NA-REFILE-%subdiv/TODO|NEXT|WAIT" "Tasks Without Effort" ''nd/skip-tasks-with-effort)
,(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)))
("e" ("e"
"Non-critical Errors" "Non-critical Errors"
(,(nd/agenda-base-task-command task-view-match "Undone Closed" ''nd/skip-non-undone-closed-todoitems) (,(nd/agenda-base-header-command task-match "Undone Closed" ''nd/skip-non-undone-closed-todoitems)
,(nd/agenda-base-task-command task-view-match "Done Unclosed" ''nd/skip-non-done-unclosed-todoitems) ,(nd/agenda-base-header-command task-match "Done Unclosed" ''nd/skip-non-done-unclosed-todoitems)
,(nd/agenda-base-project-command project-view-match "Undone Completed" :undone-complete) ,(nd/agenda-base-project-command project-match "Undone Completed" :undone-complete)
,(nd/agenda-base-project-command project-view-match "Done Incompleted" :done-incomplete))) ,(nd/agenda-base-project-command project-match "Done Incompleted" :done-incomplete)))
("A" ("A"
"Archivable Tasks and Projects" "Archivable Tasks and Projects"
(,(nd/agenda-base-task-command task-view-match "Archivable Atomic" ''nd/skip-non-archivable-atomic-tasks) (,(nd/agenda-base-header-command task-match "Archivable Atomic Tasks" ''nd/skip-non-archivable-atomic-tasks)
,(nd/agenda-base-task-command task-view-match "Stale" ''nd/skip-non-stale-headings) ,(nd/agenda-base-header-command task-match "Stale Tasks" ''nd/skip-non-stale-headings)
,(nd/agenda-base-project-command series-view-match "Archivable Series" :archivable) ,(nd/agenda-base-project-command iterator-match "Archivable Iterators" :archivable)
,(nd/agenda-base-project-command project-view-match "Archivable" :archivable)))))) ,(nd/agenda-base-project-command project-match "Archivable Projects" :archivable))))))
#+END_SRC #+END_SRC
*** keymap
#+BEGIN_SRC emacs-lisp
(evil-define-key 'motion org-agenda-mode-map "T" 'nd/toggle-project-toplevel-display)
#+END_SRC
*** views *** views
**** calendar display **** calendar display
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq org-agenda-start-on-weekday 1)
(setq org-agenda-span 'day) (setq org-agenda-span 'day)
(setq org-agenda-time-grid (quote ((daily today remove-match) (setq org-agenda-time-grid (quote ((daily today remove-match)
#("----------------" 0 16 (org-heading t)) #("----------------" 0 16 (org-heading t))
@ -1098,7 +1217,7 @@ the agenda does not do this by default...it's annoying
** column_view ** column_view
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq org-columns-default-format (setq org-columns-default-format
"%25ITEM %4TODO %TAGS %3Effort{+} %OWNER(OWN)") "%25ITEM %4TODO %TAGS %5Effort{:} %OWNER(OWN)")
(set-face-attribute 'org-column nil :background "#1e2023") (set-face-attribute 'org-column nil :background "#1e2023")
;; org-columns-summary-types ;; org-columns-summary-types