[oni-org] Bring back capture templates and agenda views
New and (hopefully) improved...
This commit is contained in:
parent
b6fb021442
commit
b0c7bc3948
1 changed files with 76 additions and 1 deletions
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
;; Author: Tom Willemse <tom@ryuslash.org>
|
;; Author: Tom Willemse <tom@ryuslash.org>
|
||||||
;; Keywords: local
|
;; Keywords: local
|
||||||
;; Version: 2023.0604.154518
|
;; Version: 2023.0607.232822
|
||||||
;; Package-Requires: (oni-yasnippet oni-alert oni-hydra org org-bullets org-edna diminish all-the-icons olivetti form-feed org-pretty-table)
|
;; Package-Requires: (oni-yasnippet oni-alert oni-hydra org org-bullets org-edna diminish all-the-icons olivetti form-feed org-pretty-table)
|
||||||
|
|
||||||
;; This program is free software; you can redistribute it and/or modify
|
;; This program is free software; you can redistribute it and/or modify
|
||||||
|
@ -1152,5 +1152,80 @@ This is done by adding a ‘:hidden t’ header argument to the code block."
|
||||||
|
|
||||||
(add-hook 'org-mode-hook #'oni-org-hide-hidden-code-blocks)
|
(add-hook 'org-mode-hook #'oni-org-hide-hidden-code-blocks)
|
||||||
|
|
||||||
|
;;; Agenda commands and capture templates
|
||||||
|
|
||||||
|
(defun oni-org--center-align (text)
|
||||||
|
"Return the same TEXT, but with enough space added in front to center align it."
|
||||||
|
(format "%s%s"
|
||||||
|
(propertize " " 'display `((space :align-to (- ,(/ (window-width) 2)
|
||||||
|
,(/ (length text) 2)))))
|
||||||
|
text))
|
||||||
|
|
||||||
|
(setf (map-elt org-agenda-custom-commands "o")
|
||||||
|
'("Overview" ((tags-todo "TODO=\"WAITING\""
|
||||||
|
((org-agenda-overriding-header (oni-org--center-align "Waiting"))))
|
||||||
|
(tags-todo "TODO=\"WIP\""
|
||||||
|
((org-agenda-overriding-header (oni-org--center-align "In Progress"))))
|
||||||
|
(agenda "" ((org-agenda-span 'day)))
|
||||||
|
(tags-todo "TODO=\"TODO\"+#todo"
|
||||||
|
((org-agenda-max-todos 10)
|
||||||
|
(org-agenda-overriding-header (oni-org--center-align "To Do"))))
|
||||||
|
(tags-todo "TODO=\"TODO\"+#reading"
|
||||||
|
((org-agenda-max-todos 5)
|
||||||
|
(org-agenda-overriding-header (oni-org--center-align "Read"))))
|
||||||
|
(tags-todo "TODO=\"TODO\"+#watching"
|
||||||
|
((org-agenda-max-todos 5)
|
||||||
|
(org-agenda-overriding-header (oni-org--center-align "Watch"))))
|
||||||
|
(tags-todo "TODO=\"TODO\"+#listening"
|
||||||
|
((org-agenda-max-todos 5)
|
||||||
|
(org-agenda-overriding-header (oni-org--center-align "Listen")))))))
|
||||||
|
|
||||||
|
(setf (map-elt org-agenda-custom-commands "t")
|
||||||
|
'("To Do" ((tags-todo "TODO=\"WAITING\"+#todo"
|
||||||
|
((org-agenda-overriding-header (oni-org--center-align "Waiting To Do"))))
|
||||||
|
(tags-todo "TODO=\"WIP\"+#todo"
|
||||||
|
((org-agenda-overriding-header (oni-org--center-align "Doing"))))
|
||||||
|
(tags-todo "TODO=\"TODO\"+#todo"
|
||||||
|
((org-agenda-overriding-header (oni-org--center-align "To Do")))))))
|
||||||
|
|
||||||
|
(setf (map-elt org-agenda-custom-commands "r")
|
||||||
|
'("Reading" ((tags-todo "TODO=\"WAITING\"+#reading"
|
||||||
|
((org-agenda-overriding-header (oni-org--center-align "Waiting To Read"))))
|
||||||
|
(tags-todo "TODO=\"WIP\"+#reading"
|
||||||
|
((org-agenda-overriding-header (oni-org--center-align "Reading"))))
|
||||||
|
(tags-todo "TODO=\"TODO\"+#reading"
|
||||||
|
((org-agenda-overriding-header (oni-org--center-align "To Read")))))))
|
||||||
|
|
||||||
|
(setf (map-elt org-agenda-custom-commands "w")
|
||||||
|
'("Watching" ((tags-todo "TODO=\"WAITING\"+#watching"
|
||||||
|
((org-agenda-overriding-header (oni-org--center-align "Waiting To Watch"))))
|
||||||
|
(tags-todo "TODO=\"WIP\"+#watching"
|
||||||
|
((org-agenda-overriding-header (oni-org--center-align "Watching"))))
|
||||||
|
(tags-todo "TODO=\"TODO\"+#watching"
|
||||||
|
((org-agenda-overriding-header (oni-org--center-align "To Watch")))))))
|
||||||
|
|
||||||
|
(setf (map-elt org-agenda-custom-commands "l")
|
||||||
|
'("Listening" ((tags-todo "TODO=\"WAITING\"+#listening"
|
||||||
|
((org-agenda-overriding-header (oni-org--center-align "Waiting To Listen To"))))
|
||||||
|
(tags-todo "TODO=\"WIP\"+#listening"
|
||||||
|
((org-agenda-overriding-header (oni-org--center-align "Listening"))))
|
||||||
|
(tags-todo "TODO=\"TODO\"+#listening"
|
||||||
|
((org-agenda-overriding-header (oni-org--center-align "To Listen To")))))))
|
||||||
|
|
||||||
|
(setf (map-elt org-capture-templates "t")
|
||||||
|
'("A simple TODO item." entry (file "") "* TODO %?
|
||||||
|
:PROPERTIES:
|
||||||
|
:CREATED: %U
|
||||||
|
:END:"))
|
||||||
|
|
||||||
|
(setf (map-elt org-capture-templates "U")
|
||||||
|
'("A TODO capture from the browser." entry (file "") "* TODO %:description
|
||||||
|
:PROPERTIES:
|
||||||
|
:CREATED: %U
|
||||||
|
:END:
|
||||||
|
|
||||||
|
%:link"
|
||||||
|
:immediate-finish t))
|
||||||
|
|
||||||
(provide 'oni-org)
|
(provide 'oni-org)
|
||||||
;;; oni-org.el ends here
|
;;; oni-org.el ends here
|
||||||
|
|
Loading…
Reference in a new issue