From 6c37a4c00cd420e50d0cd2ad088268bcbb3d9155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 1 Apr 2020 21:01:17 +0200 Subject: Update remaining code to use new config scheme. --- module/output/terminal.scm | 57 +++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 28 deletions(-) (limited to 'module/output/terminal.scm') diff --git a/module/output/terminal.scm b/module/output/terminal.scm index c344776f..e94d971d 100644 --- a/module/output/terminal.scm +++ b/module/output/terminal.scm @@ -36,34 +36,35 @@ (cur-event -1) (summary-width 30) (location-width 20)) - (for-each - (lambda (ev i) - (display - (string-append - (if (datetime? (attr ev 'DTSTART)) - (datetime->string (attr ev 'DTSTART) "~Y-~m-~d ~H:~M:~S") - ((@ (texinfo string-utils) center-string) - (date->string (attr ev 'DTSTART)) - 19)) - ; TODO show truncated string - " │ " - (if (= i cur-event) "\x1b[7m" "") - (color-escape (attr (parent ev) 'COLOR)) - ;; Summary filter is a hook for the user - (let ((dirty (attr ev 'X-HNH-DIRTY))) - (string-append - (if dirty "* " "") - (trim-to-width ((summary-filter) ev (attr ev 'SUMMARY)) (- summary-width - (if dirty 2 0))))) - STR-RESET - " │ " - (if (attr ev 'LOCATION) "" "\x1b[1;30m") - (trim-to-width - (or (attr ev 'LOCATION) "INGEN LOKAL") location-width) - STR-RESET - "\n"))) - events - (iota (length events)))) + (for-each + (lambda (ev i) + (display + (string-append + (if (datetime? (attr ev 'DTSTART)) + (datetime->string (attr ev 'DTSTART) "~Y-~m-~d ~H:~M:~S") + ((@ (texinfo string-utils) center-string) + (date->string (attr ev 'DTSTART)) + 19)) + ; TODO show truncated string + " │ " + (if (= i cur-event) "\x1b[7m" "") + (color-escape (attr (parent ev) 'COLOR)) + ;; Summary filter is a hook for the user + (let ((dirty (attr ev 'X-HNH-DIRTY))) + (string-append + (if dirty "* " "") + ;; TODO reintroduce summary-filter + (trim-to-width (attr ev 'SUMMARY) (- summary-width + (if dirty 2 0))))) + STR-RESET + " │ " + (if (attr ev 'LOCATION) "" "\x1b[1;30m") + (trim-to-width + (or (attr ev 'LOCATION) "INGEN LOKAL") location-width) + STR-RESET + "\n"))) + events + (iota (length events)))) (define (displayln a) (display a) (newline)) -- cgit v1.2.3