             [seesaw.core :as s])
   (:import [java.awt.event InputMethodListener KeyEvent KeyListener]))
 
-(defn exec-command
+(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)

   [nil "{"] :paredit-open-curly
   [nil "}"] :paredit-close-curly
   [nil "\b"] :paredit-backward-delete
   [nil "\""] :paredit-doublequote
   [nil "DEL"] :paredit-forward-delete
   ; ["C" "K"] :paredit-kill
   ["M" "("] :paredit-wrap-round
   ; ["M" ")"] :paredit-close-round-and-newline

   ["M" "{"] :paredit-open-curly
   ["M" "}"] :paredit-close-curly})

(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))))]
    (insert-result! w (exec-command! cmd w buffer))
    cmd))

(defn convert-key-event
  [event]
