       (b/selection (id :doc-lb) {:multi? true})
       (b/transform (fn [o] 
         (when (= (.getName (type (id :doc-ta))) "org.fife.ui.rsyntaxtextarea.RSyntaxTextArea")
-          (let [selected-set (set (map icon-to-name o))]
+          (let [selected-set (set o)]
             (if (= selected-set
                    (set/intersection selected-set
                                      #{"Source" "Examples" "Meta"}))

                                              :special-forms ns-special-forms %1 %2 %3)
                            })

;; Create maps from names of doc-lb entries to files containing icon
;; images, and the other direction (to efficiently map selections back
;; to names, which are used everywhere else in the code).

;;(def icon-dir "file:/Users/jafinger/clj/clj-ns-browser/resources/")
;;
;;(def name-to-icon-desc
;;  {"Doc" (str icon-dir "icon-doc.png"),
;;   "Source" (str icon-dir "icon-source.png"),
;;   "Examples" (str icon-dir "icon-examples.png"),
;;   "Comments" (str icon-dir "icon-comments.png"),
;;   "See alsos" (str icon-dir "icon-see-also.png"),
;;   "Value" (str icon-dir "icon-value.png"),
;;   "Meta" (str icon-dir "icon-meta.png")})

(def name-to-icon-desc
  {"Doc" (str (clojure.java.io/resource "icon-doc.png")),
   "Source" (str (clojure.java.io/resource "icon-source.png")),
   "Examples" (str (clojure.java.io/resource "icon-examples.png")),
   "Comments" (str (clojure.java.io/resource "icon-comments.png")),
   "See alsos" (str (clojure.java.io/resource "icon-see-also.png")),
   "Value" (str (clojure.java.io/resource "icon-value.png")),
   "Meta" (str (clojure.java.io/resource "icon-meta.png"))})

(defn update-vals-in-map [m f]
  (reduce (fn [m [k v]]
            (assoc m k (f v)))
          m m))

(def name-to-icon (update-vals-in-map name-to-icon-desc icon))

(def icon-desc-to-name (set/map-invert name-to-icon-desc))

(defn icon-to-name [i]
  (icon-desc-to-name (str i)))

(def doc-lb-name-list ["Doc" "Source" "Examples"
                        "Comments" "See alsos" "Value" "Meta"])
(def doc-lb-value-list (map name-to-icon doc-lb-name-list))
(def doc-lb-value-set (set doc-lb-value-list))
(def doc-lb-cur-order (atom doc-lb-value-list))

;; Needed for handling drag and drop to reorder items in the doc-lb
;; listbox.
(def icon-flavor (seesaw.dnd/local-object-flavor javax.swing.ImageIcon))


(def all-buttons-with-atoms

    ;; new text in doc-ta => dis/enable browser button
    (b/bind
      (id :doc-ta)
      (b/transform (fn [o] (selection (id :doc-lb) {:multi? true})))
      (b/transform (fn [o]
        (if (empty? (set/intersection (set o)
                                      #{"Examples" "See alsos" "Comments"}))
