 
 (defun floobits-remove-hooks ()
   (remove-hook 'after-change-functions 'floobits-after-change)
-  (remove-hook 'post-command-hook 'floobits-send-highlight)
+  (if (> emacs-major-version 23)
+    (progn
+      (remove-hook 'post-command-hook 'floobits-send-highlight)
+      (remove-hook 'buffer-list-update-hook 'floobits-buffer-list-change))
+    (remove-hook 'post-command-hook 'floobits-post-command-func))
+
   (remove-hook 'after-save-hook 'floobits-after-save-hook)
-  (remove-hook 'buffer-list-update-hook 'floobits-buffer-list-change)
   ; (remove-hook 'minibuffer-exit-hook 'floobits-minibuffer-hook)
   (ad-disable-advice 'delete-file 'before 'floobits-delete-file)
   (ad-disable-advice 'rename-file 'before 'floobits-rename-file))


(defun floobits-add-hooks ()
  (add-hook 'after-change-functions 'floobits-after-change nil nil)
  (add-hook 'post-command-hook 'floobits-send-highlight nil nil)
  (add-hook 'after-save-hook 'floobits-after-save-hook nil nil)
  (add-hook 'buffer-list-update-hook 'floobits-buffer-list-change nil nil)
  ; (add-hook 'minibuffer-exit-hook 'floobits-minibuffer-hook nil nil)
  (ad-enable-advice 'delete-file 'before 'floobits-delete-file)
  (ad-enable-advice 'rename-file 'before 'floobits-rename-file)

  (delq nil
  (mapcar (lambda (x) (and (funcall condp x) x)) lst)))

(defun floobits-post-command-func ()
  "used for grabbing changes in point for highlighting"
  (floobits-buffer-list-change)
  (floobits-send-highlight))

(defun floobits-agent-listener (proc string)
  (with-current-buffer "*Floobits*"
    (let ((moving (= (point) (process-mark proc)))
