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)) (org-agenda-redo))
(message "%s project view in agenda" (if nd/agenda-project-view "Showing" "Hiding"))) (message "%s project view in agenda" (if nd/agenda-project-view "Showing" "Hiding")))
(defun nd/agenda-base-task-command (header skip-fun) (defmacro nd/agenda-base-task-command (header skip-fun)
;;(quote `(tags-todo "-NA-REFILE/!"
(tags-todo "-NA-REFILE/!" ((org-agenda-overriding-header ,header)
((org-agenda-overriding-header header) (org-agenda-skip-function ,skip-fun)
(org-agenda-skip-function skip-fun) (org-agenda-todo-ignore-with-date 'all)
(org-agenda-todo-ignore-with-date 'all) (org-agenda-sorting-strategy '(category-keep)))))
(org-agenda-sorting-strategy
'(category-keep)))))
;; (defvar nd/agenda-task-commands ;; (defvar nd/agenda-task-commands
;; (quote ;; (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-tags-todo-honor-ignore-options t)
(setq org-agenda-custom-commands (setq org-agenda-custom-commands
(quote ((" " "Agenda" `((" " "Agenda"
(;;(agenda "" nil) ((agenda "" nil)
(tags "REFILE" (tags "REFILE"
((org-agenda-overriding-header "Tasks to Refile") ((org-agenda-overriding-header (if nd/agenda-project-view "Tasks to Refile" "Herro"))
(org-tags-match-list-sublevels nil))) (org-tags-match-list-sublevels nil)))
nd/agenda-base-task-command) ,(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)) ;;(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)) ;;(if nd/agenda-project-view nd/agenda-project-commands nd/agenda-task-commands))
;; (tags-todo "-NA-REFILE/!" ;; (tags-todo "-NA-REFILE/!"
;; ((org-agenda-overriding-header "Projects") ;; ((org-agenda-overriding-header "Projects")
;; (org-agenda-skip-function 'nd/skip-non-projects) ;; (org-agenda-skip-function 'nd/skip-non-projects)
;; (org-tags-match-list-sublevels 'indented) ;; (org-tags-match-list-sublevels 'indented)
;; (org-agenda-sorting-strategy ;; (org-agenda-sorting-strategy
;; '(category-keep)))) ;; '(category-keep))))
;; (tags "-NA-REFILE/" ;; (tags "-NA-REFILE/"
;; ((org-agenda-overriding-header "Tasks to Archive") ;; ((org-agenda-overriding-header "Tasks to Archive")
;; (org-agenda-skip-function 'nd/skip-non-archivable-tasks) ;; (org-agenda-skip-function 'nd/skip-non-archivable-tasks)
;; (org-tags-match-list-sublevels nil)))) ;; (org-tags-match-list-sublevels nil))))
nil)))) nil)))
(use-package org-bullets (use-package org-bullets
:ensure t :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)) (org-agenda-redo))
(message "%s project view in agenda" (if nd/agenda-project-view "Showing" "Hiding"))) (message "%s project view in agenda" (if nd/agenda-project-view "Showing" "Hiding")))
(defun nd/agenda-base-task-command (header skip-fun) (defmacro nd/agenda-base-task-command (header skip-fun)
;;(quote `(tags-todo "-NA-REFILE/!"
(tags-todo "-NA-REFILE/!" ((org-agenda-overriding-header ,header)
((org-agenda-overriding-header header) (org-agenda-skip-function ,skip-fun)
(org-agenda-skip-function skip-fun) (org-agenda-todo-ignore-with-date 'all)
(org-agenda-todo-ignore-with-date 'all) (org-agenda-sorting-strategy '(category-keep)))))
(org-agenda-sorting-strategy
'(category-keep)))))
;; (defvar nd/agenda-task-commands ;; (defvar nd/agenda-task-commands
;; (quote ;; (quote
@ -779,25 +777,25 @@ tags in the custom commands section but I find this easier to maintain and possi
#+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-custom-commands (setq org-agenda-custom-commands
(quote ((" " "Agenda" `((" " "Agenda"
(;;(agenda "" nil) ((agenda "" nil)
(tags "REFILE" (tags "REFILE"
((org-agenda-overriding-header "Tasks to Refile") ((org-agenda-overriding-header (if nd/agenda-project-view "Tasks to Refile" "Herro"))
(org-tags-match-list-sublevels nil))) (org-tags-match-list-sublevels nil)))
nd/agenda-base-task-command) ,(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)) ;;(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)) ;;(if nd/agenda-project-view nd/agenda-project-commands nd/agenda-task-commands))
;; (tags-todo "-NA-REFILE/!" ;; (tags-todo "-NA-REFILE/!"
;; ((org-agenda-overriding-header "Projects") ;; ((org-agenda-overriding-header "Projects")
;; (org-agenda-skip-function 'nd/skip-non-projects) ;; (org-agenda-skip-function 'nd/skip-non-projects)
;; (org-tags-match-list-sublevels 'indented) ;; (org-tags-match-list-sublevels 'indented)
;; (org-agenda-sorting-strategy ;; (org-agenda-sorting-strategy
;; '(category-keep)))) ;; '(category-keep))))
;; (tags "-NA-REFILE/" ;; (tags "-NA-REFILE/"
;; ((org-agenda-overriding-header "Tasks to Archive") ;; ((org-agenda-overriding-header "Tasks to Archive")
;; (org-agenda-skip-function 'nd/skip-non-archivable-tasks) ;; (org-agenda-skip-function 'nd/skip-non-archivable-tasks)
;; (org-tags-match-list-sublevels nil)))) ;; (org-tags-match-list-sublevels nil))))
nil)))) nil)))
#+END_SRC #+END_SRC
** ui ** ui