added macro to simplify agenda commands

This commit is contained in:
petrucci4prez 2018-04-04 10:35:42 -04:00
parent ed94b385ae
commit 4f6a058ec4
2 changed files with 50 additions and 54 deletions

52
conf.el
View File

@ -522,14 +522,12 @@ Using this scheme, we simply compare the magnitude of the statuscodes"
(org-agenda-redo))
(message "%s project view in agenda" (if nd/agenda-project-view "Showing" "Hiding")))
(defun nd/agenda-base-task-command (header skip-fun)
;;(quote
(tags-todo "-NA-REFILE/!"
((org-agenda-overriding-header header)
(org-agenda-skip-function skip-fun)
(org-agenda-todo-ignore-with-date 'all)
(org-agenda-sorting-strategy
'(category-keep)))))
(defmacro nd/agenda-base-task-command (header skip-fun)
`(tags-todo "-NA-REFILE/!"
((org-agenda-overriding-header ,header)
(org-agenda-skip-function ,skip-fun)
(org-agenda-todo-ignore-with-date 'all)
(org-agenda-sorting-strategy '(category-keep)))))
;; (defvar nd/agenda-task-commands
;; (quote
@ -583,25 +581,25 @@ Using this scheme, we simply compare the magnitude of the statuscodes"
(setq org-agenda-tags-todo-honor-ignore-options t)
(setq org-agenda-custom-commands
(quote ((" " "Agenda"
(;;(agenda "" nil)
(tags "REFILE"
((org-agenda-overriding-header "Tasks to Refile")
(org-tags-match-list-sublevels nil)))
nd/agenda-base-task-command)
;;(nd/agenda-base-task-command "Project next tasks" 'nd/skip-non-next-project-tasks))
;;(if nd/agenda-project-view nd/agenda-project-commands nd/agenda-task-commands))
;; (tags-todo "-NA-REFILE/!"
;; ((org-agenda-overriding-header "Projects")
;; (org-agenda-skip-function 'nd/skip-non-projects)
;; (org-tags-match-list-sublevels 'indented)
;; (org-agenda-sorting-strategy
;; '(category-keep))))
;; (tags "-NA-REFILE/"
;; ((org-agenda-overriding-header "Tasks to Archive")
;; (org-agenda-skip-function 'nd/skip-non-archivable-tasks)
;; (org-tags-match-list-sublevels nil))))
nil))))
`((" " "Agenda"
((agenda "" nil)
(tags "REFILE"
((org-agenda-overriding-header (if nd/agenda-project-view "Tasks to Refile" "Herro"))
(org-tags-match-list-sublevels nil)))
,(macroexpand '(nd/agenda-base-task-command "Atomic tasks" 'nd/skip-non-atomic-tasks)))
;;(nd/agenda-base-task-command "Project next tasks" 'nd/skip-non-next-project-tasks))
;;(if nd/agenda-project-view nd/agenda-project-commands nd/agenda-task-commands))
;; (tags-todo "-NA-REFILE/!"
;; ((org-agenda-overriding-header "Projects")
;; (org-agenda-skip-function 'nd/skip-non-projects)
;; (org-tags-match-list-sublevels 'indented)
;; (org-agenda-sorting-strategy
;; '(category-keep))))
;; (tags "-NA-REFILE/"
;; ((org-agenda-overriding-header "Tasks to Archive")
;; (org-agenda-skip-function 'nd/skip-non-archivable-tasks)
;; (org-tags-match-list-sublevels nil))))
nil)))
(use-package org-bullets
:ensure t

View File

@ -716,14 +716,12 @@ tags in the custom commands section but I find this easier to maintain and possi
(org-agenda-redo))
(message "%s project view in agenda" (if nd/agenda-project-view "Showing" "Hiding")))
(defun nd/agenda-base-task-command (header skip-fun)
;;(quote
(tags-todo "-NA-REFILE/!"
((org-agenda-overriding-header header)
(org-agenda-skip-function skip-fun)
(org-agenda-todo-ignore-with-date 'all)
(org-agenda-sorting-strategy
'(category-keep)))))
(defmacro nd/agenda-base-task-command (header skip-fun)
`(tags-todo "-NA-REFILE/!"
((org-agenda-overriding-header ,header)
(org-agenda-skip-function ,skip-fun)
(org-agenda-todo-ignore-with-date 'all)
(org-agenda-sorting-strategy '(category-keep)))))
;; (defvar nd/agenda-task-commands
;; (quote
@ -779,25 +777,25 @@ tags in the custom commands section but I find this easier to maintain and possi
#+BEGIN_SRC emacs-lisp
(setq org-agenda-tags-todo-honor-ignore-options t)
(setq org-agenda-custom-commands
(quote ((" " "Agenda"
(;;(agenda "" nil)
(tags "REFILE"
((org-agenda-overriding-header "Tasks to Refile")
(org-tags-match-list-sublevels nil)))
nd/agenda-base-task-command)
;;(nd/agenda-base-task-command "Project next tasks" 'nd/skip-non-next-project-tasks))
;;(if nd/agenda-project-view nd/agenda-project-commands nd/agenda-task-commands))
;; (tags-todo "-NA-REFILE/!"
;; ((org-agenda-overriding-header "Projects")
;; (org-agenda-skip-function 'nd/skip-non-projects)
;; (org-tags-match-list-sublevels 'indented)
;; (org-agenda-sorting-strategy
;; '(category-keep))))
;; (tags "-NA-REFILE/"
;; ((org-agenda-overriding-header "Tasks to Archive")
;; (org-agenda-skip-function 'nd/skip-non-archivable-tasks)
;; (org-tags-match-list-sublevels nil))))
nil))))
`((" " "Agenda"
((agenda "" nil)
(tags "REFILE"
((org-agenda-overriding-header (if nd/agenda-project-view "Tasks to Refile" "Herro"))
(org-tags-match-list-sublevels nil)))
,(macroexpand '(nd/agenda-base-task-command "Atomic tasks" 'nd/skip-non-atomic-tasks)))
;;(nd/agenda-base-task-command "Project next tasks" 'nd/skip-non-next-project-tasks))
;;(if nd/agenda-project-view nd/agenda-project-commands nd/agenda-task-commands))
;; (tags-todo "-NA-REFILE/!"
;; ((org-agenda-overriding-header "Projects")
;; (org-agenda-skip-function 'nd/skip-non-projects)
;; (org-tags-match-list-sublevels 'indented)
;; (org-agenda-sorting-strategy
;; '(category-keep))))
;; (tags "-NA-REFILE/"
;; ((org-agenda-overriding-header "Tasks to Archive")
;; (org-agenda-skip-function 'nd/skip-non-archivable-tasks)
;; (org-tags-match-list-sublevels nil))))
nil)))
#+END_SRC
** ui