    ["M" "{"] :paredit-open-curly
    ["M" "}"] :paredit-close-curly})
 
-(defn exec-paredit
+(def ^:const special-chars
+  #{"(" ")" "[" "]" "{" "}" "\""}) ;; \"
+
+(defn exec-paredit!
   [k w buffer enable-default? enable-advanced?]
   (when-let [cmd (or (and enable-default?
                           (default-keymap k))
                      (and @enable-advanced?
                           (or (advanced-keymap k)
                               (foreign-keymap k))))]
-    (let [result (exec-command cmd w buffer)]
-      (insert-result w result))
+    (insert-result! w (exec-command! cmd w buffer))
     cmd))
-
-(defn convert-input-method-event
-  [event]
-  ["M" (os-x-charmap (str (.first (.getText event))))])
 
 (defn convert-key-event
   [event]

                           :length (- (.getSelectionEnd widget)
                                      (.getSelectionStart widget))})))

(defn insert-result
  [w pe]
  (dorun
    (map #(if (= 0 (:length %))

            [seesaw.core :as s])
  (:import [java.awt.event InputMethodListener KeyEvent KeyListener]))

(defn exec-command!
  [cmd widget buffer]
  (let [old-parse-tree (paredit.parser/buffer-parse-tree @buffer nil)
        old-text (paredit.loc-utils/node-text old-parse-tree)
