 (defn ns-unloaded [] @all-ns-unloaded-atom)
 (swap! all-ns-unloaded-atom (fn [& a] (all-ns-unloaded)))
 (swap! all-ns-loaded-atom (fn [& a] (all-ns-loaded)))
+(def group-vars-by-object-type (atom true))
 
 
 ;; bind specific fns

            [seesaw.bind :as b]
            [clojure.java.browse]
            [clojure.java.shell]
            [clj-ns-browser.inspector]
            [seesaw.meta]
            [clojure.java.javadoc]

                       (or (re-find r (:doc %))
                           (re-find r (str (:name %))))))
         (map #(str (:ns %) "/" (:name %))))))


(defn better-get-docs-map [fqn]
  (if (= fqn "clojure.core//")
    {:object-type-str "Function"}
    (d2m/get-docs-map fqn)))


(defn simplify-object-type [obj-type-str]
  (cond
   (nil? obj-type-str) "(nil)"
   (re-find #"^Var .*" obj-type-str) "Var"
   :else obj-type-str))


(defn group-by-object-type [symbol-str-seq fqns? ns-str]
  (let [symbol-info (map (fn [s]
                               (let [fqn (if fqns? s (str ns-str "/" s))
                                     obj-type-str (-> fqn
                                                      ;;d2m/get-docs-map
                                                      better-get-docs-map
                                                      :object-type-str
                                                      simplify-object-type)]
                                 {:orig-str s
                                  :fqn-str fqn
                                  :obj-type-str obj-type-str}))
                             symbol-str-seq)
        groups (group-by :obj-type-str symbol-info)]
    (apply concat (interpose
                   [ " " ]
                   (map (fn [[obj-type-str l]]
                          (concat [ (str "        " obj-type-str) ]
                                  (sort (map :orig-str l))))
                        (sort-by first (seq groups)))))))


(defn widget-model-count
