       (throw (Exception. (format "Don't know how to get a tree from this thing. keys=> %s, meta=> %s"
                                  (keys v)
                                  (meta v)))))))
+
+
+(defmacro with-this-printer
+  "Sets the printer as `prn` for the lexical scope. `prn` may be a
+  printer map or a vector. See `(doc mk-printer)` for details on the
+  latter."
+  ([prn & body]
+   `(let [prn# (if (vector? ~prn)
+                 (mk-printer ~prn)
+                 ~prn)]
+      (binding [so/*max-chars* (or (:max-chars prn#)
+                                   so/*max-chars*)
+                so/*max-arg-lines* (or (:max-arg-lines prn#)
+                                       so/*max-arg-lines*)
+                so/*selector* (or (:selector prn#)
+                                  so/*selector*)]
+        ~@body))))
+
+(defmacro with-printer
+  "Puts the printer in effect for the lexical scope."
+  ([& body]
+   `(with-this-printer @printer ~@body)))
 
 (defn trees-print
   "Prints `trees`, which may be either trace tree, a collection of trace

  (reset! printer
          (mk-printer opts)))

(defmacro with-this-printer
  "Sets the printer as `prn` for the lexical scope. `prn` may be a
  printer map or a vector. See `(doc mk-printer)` for details on the
  latter."
  ([prn & body]
   `(let [prn# (if (vector? ~prn)
                 (mk-printer ~prn)
                 ~prn)]
      (binding [so/*max-chars* (or (:max-chars prn#)
                                   so/*max-chars*)
                so/*max-arg-lines* (or (:max-arg-lines prn#)
                                       so/*max-arg-lines*)
                so/*selector* (or (:selector prn#)
                                  so/*selector*)]
        ~@body))))

(defmacro with-printer
  "Puts the printer in effect for the lexical scope."
  ([& body]
   `(with-this-printer @printer ~@body)))

;; === END String Output functions



(declare ws-query*)
(declare ws-query)
(declare ws-print)

;; === Helper functions

