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
([path
(expand-user-path (expand-user-path
(string-append (string-append
program-path program-path
program-directory program-directory
program-file))]) program-file))])
(let ([todo-items (let
([todo-items
(file->lines path (file->lines path
#:mode 'text #:mode 'text
#:line-mode 'linefeed)]) #: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)