From 3496363535694d6b0b8eecbd0ef3f1115e9ea841 Mon Sep 17 00:00:00 2001 From: Aaron France Date: Sun, 17 Aug 2014 15:11:37 +0200 Subject: [PATCH] Add key to allow silencing quickload Specifying :silent t to quickload will force all output to be ignored. --- quicklisp/client.lisp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/quicklisp/client.lisp b/quicklisp/client.lisp index cef8df8..16f28ef 100644 --- a/quicklisp/client.lisp +++ b/quicklisp/client.lisp @@ -17,21 +17,27 @@ :initarg :system :reader not-quickloadable-system))) -(defgeneric quickload (systems &key verbose prompt explain &allow-other-keys) +(defun maybe-silence (silent stream) + (or (and silent (make-broadcast-stream)) stream)) + +(defgeneric quickload (systems &key verbose silent prompt explain &allow-other-keys) (:documentation "Load SYSTEMS the quicklisp way. SYSTEMS is a designator for a list of things to be loaded.") (:method (systems &key (prompt *quickload-prompt*) + (silent nil) (verbose *quickload-verbose*) &allow-other-keys) - (unless (consp systems) - (setf systems (list systems))) - (dolist (thing systems systems) - (flet ((ql () - (autoload-system-and-dependencies thing :prompt prompt))) - (if verbose - (ql) - (call-with-quiet-compilation #'ql)))))) + (let ((*standard-output* (maybe-silence silent *standard-output*)) + (*trace-output* (maybe-silence silent *trace-output*))) + (unless (consp systems) + (setf systems (list systems))) + (dolist (thing systems systems) + (flet ((ql () + (autoload-system-and-dependencies thing :prompt prompt))) + (if verbose + (ql) + (call-with-quiet-compilation #'ql))))))) (defmethod quickload :around (systems &key verbose prompt explain &allow-other-keys)