summaryrefslogtreecommitdiffstats
path: root/undone/main.scm
diff options
context:
space:
mode:
Diffstat (limited to 'undone/main.scm')
-rw-r--r--undone/main.scm11
1 files changed, 11 insertions, 0 deletions
diff --git a/undone/main.scm b/undone/main.scm
index 2f400e9..f627c31 100644
--- a/undone/main.scm
+++ b/undone/main.scm
@@ -157,6 +157,14 @@
(cons var val)))
args))))))
+(define (delete args)
+ "Delete the specified element."
+ (set! todo-list
+ (filter (lambda (elm)
+ (not (eq? (get-field-value id elm)
+ (string->number (car args)))))
+ todo-list)))
+
(define-view default
"Default todo-list view, show only the title."
"~2d ~a~%" id content)
@@ -188,6 +196,9 @@
((add)
(add (list-tail args 2))
(save))
+ ((delete)
+ (delete (list-tail args 2))
+ (save))
((view)
(view (list-tail args 2)))
((views)