Commit 1ee9ab14 authored by Victor A. Stoichiţă's avatar Victor A. Stoichiţă
Browse files

[org] gtd custom agenda commands, todo keywords and tags

parent f6e310dc
......@@ -99,45 +99,82 @@
org-agenda-skip-function)
(set (make-variable-buffer-local 'org-deadline-warning-days) org-deadline-warning-days))
;;;; Custom agenda commands
(setq org-agenda-custom-commands
'(("e" "Test" agenda ""
((org-agenda-files "~/calendriers/agendaList-calendriers.org")
;; ensures that repeating events appear on all relevant dates
(org-agenda-repeating-timestamp-show-all t)
(org-agenda-skip-function '(org-agenda-skip-entry-if 'todo '("*")))))
;;;; Custom agenda commands
(setq org-agenda-prefix-format '((agenda . " %i %-12:c%?-12t% s")
;; (todo . " %i %-12:c")
(todo . " %i %-12:c%?-12t%b")
(tags . " %i %-12:c%?-12t%b")
(search . " %i %-12:c")))
(setq org-agenda-remove-tags-when-in-prefix 'prefix)
(defun vic/org-gtd-files ()
"List files for Getting Things Done workflow.
Used as org-agenda-files and as org-refile-targets"
(let ((gtd-dir "~/org/")
(gtd-files '("in.org"
"unjour.org"
"encours.org"
"tickler.org")))
(mapcar
(lambda (x)
(concat vic/org-gtd-directory x)) gtd-files)))
(defun vic/org-current-is-todo-no-timestamp ()
(string= "FAIRE" (org-get-todo-state)))
(defun vic/org-agenda-skip-all-siblings-but-first ()
"Skip all but the first non-done entry.
From Nicolas Petton https://emacs.cafe/emacs/orgmode/gtd/2017/06/30/orgmode-gtd.html"
(let (should-skip-entry)
(unless (vic/org-current-is-todo-no-timestamp)
(setq should-skip-entry t))
(save-excursion
(while (and (not should-skip-entry) (org-goto-sibling t))
(when (vic/org-current-is-todo-no-timestamp)
(setq should-skip-entry t))))
(when should-skip-entry
(or (outline-next-heading)
(goto-char (point-max))))))
("c" . "Calendar")
("ca" "Agenda sans todo" agenda* ""
((org-agenda-files "~/calendriers/agendaList-calendriers.org")
(setq org-agenda-custom-commands
'(("v" "Agenda sans todo" agenda* ""
((org-agenda-files '("~/calendriers"))
;; ensures that repeating events appear on all relevant dates
(org-agenda-repeating-timestamp-show-all t)))
("ct" "Agenda du jour sans todo"
("f" "Agenda avec todo" ; block agenda
((agenda ""
((org-agenda-span 1)
(org-agenda-files "~/calendriers/agendaList-calendriers.org")))
(alltodo ""
((org-agenda-skip-function '(org-agenda-skip-entry-if '(scheduled deadline)))
(org-agenda-files "~/calendriers/agendaList-calendriers.org")))))
("cc" "Calendar view" cfw:open-org-calendar
(org-agenda-files '("~/calendriers" "~/org/encours.org" "~/org/tickler.org"))))
(todo "FAIRE"
((org-agenda-files '("~/org/encours.org"))
(org-agenda-skip-function 'vic/org-agenda-skip-all-siblings-but-first)
(org-agenda-prefix-format '((todo . " %i %?-12t%(vic/org-get-parent-title-at-level 2 \": \")")))
(org-agenda-overriding-header "Projets")))))
("l" "Calendar view" cfw:open-org-calendar
((org-agenda-files "~/calendriers/agendaList-calendriers.org")))))
(defun vic/org-get-parent-title-at-level (level &optional separator)
"Get title of parent heading at LEVEL. Append optional SEPARATOR string.
Returns empty string of no heading at LEVEL."
(let ((titles (org-get-outline-path))
(separator (or separator nil)))
(if (<= level (length titles))
(concat (nth (- level 1) titles) separator)
"")))
;;; TODO:
(setq org-todo-keywords
'((sequence "TODO" "|" "DONE")
(sequence "RÉPONDRE" "|" "OK")
(sequence "LIRE" "NOTES" "|" "LU")
(sequence "PLANIFIER" "ACHETER" "FAIRE" "|" "FAIT" "REPOUSSÉ")
(sequence "|" "ANNULÉ")))
(setq org-todo-keyword-faces
'(("LIRE" . org-sexp-date)
("NOTES" . org-sexp-date)
("MAIL" . compilation-warning)
("RÉPONDRE" . compilation-warning)
("TWEAK" . "Magenta")
("PUBLIER" . "Magenta")))
'((sequence "FAIRE(t)" "ATTENTE(a)" "|" "FAIT(d)" "ABANDON(c)")
(sequence "TODO" "WAITING(w)" "|" "DONE" "CANCELLED")))
(setq org-tag-faces
'(("lire" . org-sexp-date)
("notes" . org-sexp-date)
("mail" . compilation-warning)
("tel" . compilation-warning)
("ordis" . "Magenta")
("webm" . "Magenta")))
(setq org-log-done (quote time)
org-log-into-drawer t)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment