aboutsummaryrefslogtreecommitdiffstats
path: root/scrumelo.el
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-05-20 14:32:27 +0200
committerGravatar Tom Willemse2013-05-20 14:32:27 +0200
commit13c036e82e9f275bacf45c48f746833be00691e3 (patch)
treec94449ae859f380af3c1e7c80b4bda0ff5189e4e /scrumelo.el
parent6a1d1398a223b18c5df9c98396f389b72a13e475 (diff)
downloadscrumelo-13c036e82e9f275bacf45c48f746833be00691e3.tar.gz
scrumelo-13c036e82e9f275bacf45c48f746833be00691e3.zip
Add an icon before TODO state
Diffstat (limited to 'scrumelo.el')
-rw-r--r--scrumelo.el12
1 files changed, 10 insertions, 2 deletions
diff --git a/scrumelo.el b/scrumelo.el
index c97a6d4..d3449e1 100644
--- a/scrumelo.el
+++ b/scrumelo.el
@@ -59,10 +59,18 @@
(org-entry-get (point) "Necessity")
(nth 4 (org-heading-components))))
+(defun scrumelo--task-state-class (state)
+ "Return the correct icon class for STATE."
+ (cdr (assoc state '(("TODO" . "icon-check-empty")
+ ("DOING" . "icon-sign-blank")
+ ("DONE" . "icon-check")))))
+
(defun scrumelo--story-row ()
"Return a table row for the current org headline."
- `(tr (td ,(org-entry-get (point) "TODO"))
- (td ,(scrumelo--story))))
+ (let ((state (org-entry-get (point) "TODO")))
+ `(tr (td (i (@ (class ,(scrumelo--task-state-class state))) "")
+ " " ,state)
+ (td ,(scrumelo--story)))))
(defun scrumelo--maybe-story-row ()
"If looking at a top level heading, return a table row for it."