   :paredit-open-round
   [cmd {:keys [text offset length] :as t}]
   #_(prn "t:" t)
-  (open-balanced [\( \)] t))
+  (open-balanced [\( \)] t 
+    (into *real-spaces* *open-brackets*)
+    (into *extended-spaces* *close-brackets*)))
     
 (defmethod paredit 
   :paredit-open-square
   [cmd {:keys [text offset length] :as t}]
   #_(prn "t:" t)
-  (open-balanced [\[ \]] t))
+  (open-balanced [\[ \]] t
+    (into *real-spaces* *open-brackets*)
+    (into *extended-spaces* *close-brackets*)))
+    
+(defmethod paredit 
+  :paredit-open-curly
+  [cmd {:keys [text offset length] :as t}]
+  #_(prn "t:" t)
+  (open-balanced [\{ \}] t
+    (conj (into *real-spaces* *open-brackets*) \#) ; add # for not inserting space before a set
+    (into *extended-spaces* *close-brackets*)))
     
 (defn test-command [title-prefix command]
   (testing (str title-prefix " " (second command) " (\"" (first command) "\")")

	                 "(defun f (x)\n  |)"
	                "; (Foo.|"
	                 "; (Foo.)|"}]
	    ["["         :paredit-open-square
                 {"(a b |c d)"  "(a b [|] c d)"
                  "(foo \"bar |baz\" quux)" "(foo \"bar [|baz\" quux)"}
                  {"(a b|c d)" "(a b [|] c d)"

(defmulti paredit (fn [k & args] k))

(defn open-balanced
  [[o c] {:keys [text offset length] :as t} 
   chars-with-no-space-before chars-with-no-space-after]
  #_(prn "t:" t)
  (if (in-code? text offset)
    (let [add-pre-space? (not (contains? chars-with-no-space-before 
                                         (previous-char t)))
          add-post-space? (not (contains? chars-with-no-space-after 
                                          (next-char t)))
          ins-str (str (if add-pre-space? " " "")
                       (str o c)
                       (if add-post-space? " " ""))
