cleaning up show-list function

main
m455 2018-04-09 19:40:47 -04:00
parent c7beb0dfd0
commit bcc3038505
1 changed files with 20 additions and 15 deletions

View File

@ -118,24 +118,29 @@
'no 'no
'("no" "No" "n" "N"))) '("no" "No" "n" "N")))
(define (create-bullets)
(lambda (lst)
(string-append
bullet
" "
lst)))
(define (show-list) (define (show-list)
(let ([path (let
(expand-user-path ([path
(string-append (expand-user-path
program-path (string-append
program-directory program-path
program-file))]) program-directory
(let ([todo-items program-file))])
(file->lines path (let
#:mode 'text ([todo-items
#:line-mode 'linefeed)]) (file->lines path
#:mode 'text
#:line-mode 'linefeed)])
(display (display
(string-join (string-join
(map (lambda (lst) (map (create-bullets)
(string-append
bullet
" "
lst))
todo-items) "\n"))))) todo-items) "\n")))))
(define (add-item-to-file item) (define (add-item-to-file item)