     (remove-hook 'post-command-hook 'floobits-post-command-func))
 
   (remove-hook 'after-save-hook 'floobits-after-save-hook)
+  (remove-hook 'minibuffer-exit-hook 'floobits-minibuffer-exit-hook)
   (ad-disable-advice 'delete-file 'before 'floobits-delete-file)
   (ad-disable-advice 'rename-file 'before 'floobits-rename-file))
 

      (floobits-destroy-connection))))

(defun floobits-event-user_input (req)
  (let* ((choices (floo-get-item req 'choices))
        (choices (and choices (mapcar (lambda (x) (append x nil)) choices)))
        (prompt (floo-get-item req 'prompt))
        (initial (floo-get-item req 'initial)))
    (floo-set-item 'req 'response
      (cond
        (choices (completing-read prompt choices nil t initial))
        ((floo-get-item req 'y_or_n) (yes-or-no-p prompt))
        (t (read-from-minibuffer prompt initial))))
  (floobits-send-to-agent req 'user_input)))

(defun floobits-event-rename_buf (req)
  (let* ((old-path (floo-get-item req 'old_path))

(defvar floobits-last-highlight)
(defvar floobits-username)
(defvar floobits-secret)
(defvar floobits-user-input-events)


(defun floobits-initialize ()
  (setq floobits-agent-buffer "")
  (setq floobits-user-input-events nil)
  (setq floobits-conn nil)
  (setq floobits-current-position '((mark . 1) (point . 1) (name . "")))
  (setq floobits-open-buffers nil)
