Update org capture templates

This commit is contained in:
Tom Willemse 2015-04-08 15:16:25 +02:00
parent 689036a6b9
commit 3ccd481d04

View file

@ -67,6 +67,15 @@
(file-name-base (directory-file-name desktop-dirname)))) (file-name-base (directory-file-name desktop-dirname))))
"\n %?")) "\n %?"))
(defun taiga-org-task-template ()
"Turn taiga task TASK into an org task."
(let* ((project (taiga-read-project))
(user-story (taiga-read-userstory (alist-get 'id project)))
(task (taiga-read-task (alist-get 'id project)
(alist-get 'id user-story))))
(concat
"* " (alist-get 'subject task) "\n")))
(defun oni:org-maybe-outline-path () (defun oni:org-maybe-outline-path ()
(let ((outline-path (org-format-outline-path (org-get-outline-path)))) (let ((outline-path (org-format-outline-path (org-get-outline-path))))
(unless (string= outline-path "") (unless (string= outline-path "")
@ -112,10 +121,10 @@
(setq org-capture-templates (setq org-capture-templates
`(("t" "Task" entry (file+headline "~/documents/org/tasks" "Inbox") `(("t" "Task" entry (file+headline "~/documents/org/tasks" "Inbox")
"* TODO %? %(org-init-get-tag-name)" "* TODO %? %(org-init-get-tag-name)"
:empty-lines-before 1) :empty-lines 1)
("T" "Linked task" entry (file "~/documents/org/tasks" "Inbox") ("T" "Linked task" entry (file "~/documents/org/tasks" "Inbox")
"* TODO %? %(org-init-get-tag-name)\n\n %a" "* TODO %? %(org-init-get-tag-name)\n\n %a"
:empty-lines-before 1) :empty-lines 1)
("a" "Appointment" entry (file "~/documents/org/tasks" "Inbox") ("a" "Appointment" entry (file "~/documents/org/tasks" "Inbox")
"* %?\n %^T\n\n %a" "* %?\n %^T\n\n %a"
:empty-lines-before 1) :empty-lines-before 1)
@ -124,6 +133,12 @@
:empty-lines-before 1) :empty-lines-before 1)
("l" "Log entry" entry (file+datetree "~/documents/org/log.org") ("l" "Log entry" entry (file+datetree "~/documents/org/log.org")
"* %<%c>\n <%<%Y-%m-%d %H:%M>>\n\n %?" "* %<%c>\n <%<%Y-%m-%d %H:%M>>\n\n %?"
:empty-lines-before 1)
("d" "10 things to do today" entry (file+datetree "~/documents/org/dailies.org")
"* %<%R> [0/10]\n\n - [ ] %?\n - [ ] \n - [ ] \n - [ ] \n - [ ] \n - [ ] \n - [ ] \n - [ ] \n - [ ] \n - [ ] "
:empty-lines-before 1)
("w" "Taiga task" entry (file+headline "~/documents/org/tasks" "Inbox")
(function taiga-org-task-template)
:empty-lines-before 1))) :empty-lines-before 1)))
(setq org-contacts-files '("~/documents/org/misc/contacts.org")) (setq org-contacts-files '("~/documents/org/misc/contacts.org"))
(setq org-agenda-show-outline-path nil) (setq org-agenda-show-outline-path nil)