(define-module (cybo)) (use-modules (ice-9 rdelim) ) (define UTF-8_ENCODING "UTF-8") (define TAG_LENGTH_PRIORITY 3) (define TAG_INDEX_PRIORITY 0) (define-public next-actions (lambda (filename) (sort-by-priority (all-tasks filename)))) (define (sort-by-priority task-list) (stable-sort task-list (lambda (task1 task2) (stringscm filename) '())) (define (exist? filename) (access? filename F_OK)) (define (todo.txt->scm filename) (call-with-input-file filename (lambda (file-port) (let loop ((line (read-line file-port)) (todo-list '())) (if (eof-object? line) (reverse todo-list) (loop (read-line file-port) (cons line todo-list))))) #:encoding UTF-8_ENCODING))