                    "(a,|)" "(a, [|])"
                    "\\| " "\\[| "
                    "\\\\| " "\\\\ [|] "}]
+      ["]"         :paredit-close-square
+                  {#_"(define-key keymap [frob|  ] 'frobnicate)"
+                   #_"(define-key keymap [frob]| 'frobnicate)"
+                   "; [Bar.|" "; [Bar.]|"
+                   "  \"Hello,| world!\" foo" "  \"Hello,]| world!\" foo"
+                   "  \"Hello,| world!" "  \"Hello,]| world!"
+                   "foo \\|" "foo \\]|"}]
       ["{"         :paredit-open-curly ; this command does not exist in paredit AFAIK
                  {"(a b |c d)"  "(a b {|} c d)"
                   "(foo \"bar |baz\" quux)" "(foo \"bar {|baz\" quux)"}

	                 "(a,|)" "(a, (|))"
	                 "\\| " "\\(| "
	                 "\\\\| " "\\\\ (|) "}]
	    #_[")"         :paredit-close-round
	                {"(a b |c   )" "(a b c)|"
	                "; Hello,| world!"
	                 "; Hello,)| world!"}]
	    #_["M-)"       :paredit-close-round-and-newline
	                {"(defun f (x|  ))"
	                 "(defun f (x)\n  |)"
	                "; (Foo.|"
	                 "; (Foo.)|"}]
      ["["         :paredit-open-square
                 {"(a b |c d)"  "(a b [|] c d)"

      (-> t (insert ins-str) (shift-offset offset-shift)))
    (-> t (insert (str o)))))
  
(defn close-balanced
  [[o c] {:keys [text offset length] :as t} 
   chars-with-no-space-before chars-with-no-space-after]
  #_(prn "t:" t)
  (-> t (insert (str c)))
  #_(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? " " ""))
          offset-shift (if add-post-space? -2 -1)]
      #_(prn "ins-str:" ins-str)
      (-> t (insert ins-str) (shift-offset offset-shift)))
    (-> t (insert (str o)))))

(defmethod paredit 
  :paredit-open-round
