(setq load-path (cons "~/Dev/dist/org-mode/lisp" load-path))
(setq load-path (cons "~/Dev/dist/org-mode/contrib/lisp" load-path))
(add-to-list 'Info-default-directory-list
             (expand-file-name "~/Dev/dist/org-mode/doc"))
(require 'org-install)
(require 'org)
(require 'org-faces)

(setq org-directory "~/Dev/dist/org-mode/errors/faces/")
(setq org-agenda-files (list org-directory))

(setq org-agenda-before-sorting-filter-function 'todo-colorize)
(setq org-agenda-custom-commands 
      '(("t" "Todo list" todo "TODO"
         ())))

(defface due
  (org-compatible-face 'default
    '((t (:foreground "#000000"))))
  "Face for due items"
  :group 'org-faces)
(set-face-foreground 'due "#dc322f")

(defun todo-colorize (a)
  (let* ()
    ;; Remove the TODO
    (put-text-property
     0 (length a)
     'txt
     (replace-regexp-in-string "^TODO *" "" (get-text-property 0 'txt a))
     a)

    ;; Remove the old face
    (remove-text-properties 0 (length a) '((face nil) (fontified nil)) a)

    ;; Put on the new face
    (put-text-property 0 (length a) 'face 'due a)

    a))

(org-agenda "" "t")
(org-agenda-columns)
