From: Christopher Allan Webber Date: Sun, 24 Apr 2016 19:18:56 +0000 (-0500) Subject: agenda: Make agendas run with "easier" default arguments X-Git-Tag: v0.2.0~69 X-Git-Url: https://jxself.org/git/?p=8sync.git;a=commitdiff_plain;h=c1c7225a35511bbfd2362ca0d5359fb2f1fbb8f6 agenda: Make agendas run with "easier" default arguments * 8sync/agenda.scm (make-agenda): Set #:pre-unwind-handler to print-error-and-continue. This makes it so that by default, exceptions get printed to the shell in which the agenda was spawned. (start-agenda): Set #:stop-condition to stop-on-nothing-to-do. This is a bit heavier than maybe desirable but is a good "default" stop condition, and prevents the agenda from entering into a busy-loop when computation has finished. --- diff --git a/8sync/agenda.scm b/8sync/agenda.scm index db8180b..195b23a 100644 --- a/8sync/agenda.scm +++ b/8sync/agenda.scm @@ -138,7 +138,7 @@ Generally done automatically for the user through (make-agenda)." (schedule (make-schedule)) (time (gettimeofday)) (catch-handler #f) - (pre-unwind-handler #f)) + (pre-unwind-handler print-error-and-continue)) ;; TODO: document arguments "Make a fresh agenda." (make-agenda-intern queue prompt @@ -742,7 +742,7 @@ Also handles sleeping when all we have to do is wait on the schedule." #:key ;; @@: Should we make stop-on-nothing-to-do ;; the default stop-condition? - stop-condition + (stop-condition stop-on-nothing-to-do) (get-time gettimeofday) (handle-ports update-agenda-from-select!)) ;; TODO: Document fields