            (re-pattern (str term))))
        terms))
 
-(defn find-ugen-specs
+(defn- find-matching-ugen-specs
+  "Find ugen specs by searching their :full-doc strings for occurances of all the
+  terms. Terms can either be strings or regexp patterns."
   [terms]
   (let [regexps (map-terms-to-regexps terms)]
     (sort-by

                      (= matches regexps)))
                  (seq UGEN-SPECS))))))

(defn find-ug
  [& search-terms]
  (let [specs            (find-ugen-specs search-terms)
        names            (map #(overtone-ugen-name (:name %)) specs)
        longest-name-len (length-of-longest-string names)]
    (dorun
     (map
      (fn [spec]
        (let [n (str (overtone-ugen-name (:name spec)))
              n (gen-padding n (+ 2 (- longest-name-len (.length n))) " ")
              s (indented-str-block (get spec :summary "") DOC-WIDTH (+ 4 longest-name-len))]
          (println (str n "  " s))))

      specs))))

(defn find-ug-doc
  [& search-terms]
  (let [specs (find-ugen-specs search-terms)]
    (dorun
     (map #(println (str "  " (overtone-ugen-name (:name %)) "\n" (:full-doc %) "\n\n  -------------") ) specs))))

        [overtone.util lib doc]))

(defn- map-terms-to-regexps
  "convert a list of patterns/objects to a list of patterns by not modifying
  the regex patterns and converting other objects to strings and the strings
  to regex patterns. Typically the other obects will be standard strings."
  [terms]
  (map (fn [term]
         (if (= java.util.regex.Pattern (type term))
