agenda: Make agendas run with "easier" default arguments
authorChristopher Allan Webber <cwebber@dustycloud.org>
Sun, 24 Apr 2016 19:18:56 +0000 (14:18 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Sun, 24 Apr 2016 19:18:56 +0000 (14:18 -0500)
* 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.

8sync/agenda.scm

index db8180b0e0dede289f147f903f4de3b9d0844f1a..195b23a300354bd183ffe4d2e8b3251b908c27d9 100644 (file)
@@ -138,7 +138,7 @@ Generally done automatically for the user through (make-agenda)."
                       (schedule (make-schedule))
                       (time (gettimeofday))
                       (catch-handler #f)
                       (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
   ;; 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?
                        #: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
                        (get-time gettimeofday)
                        (handle-ports update-agenda-from-select!))
   ;; TODO: Document fields