                                                                                         (member username floobits-follow-users))) (not following))))
          (buffer (or buffer (and should-jump (find-file path)))))
 
-    (floo-when-buf buffer
-                   (floobits-apply-highlight user_id buffer ranges)
-                   (goto-char pos)
-                   (bookmark-set (format "floobits-%s-%s" username user_id)))
+    (floobits--when-buf buffer
+      (floobits-apply-highlight user_id buffer ranges)
+      (goto-char pos)
+      (bookmark-set (format "floobits-%s-%s" username user_id)))
 
     (when should-jump
       (unless (window-minibuffer-p (get-buffer-window))

              (error))))))))

(defun floobits-event-save (req)
  (floo-when-buf (get-file-buffer (floobits--get-item req 'full_path))
                 (remove-hook 'after-save-hook 'floobits-after-save-hook)
                 (save-buffer)
                 (add-hook 'after-save-hook 'floobits-after-save-hook)))

(defun floobits-apply-edit (edit)
  (let* ((inhibit-modification-hooks t)

  "Associate KEY with VALUE in the alist stored in ALIST-VAR."
  `(add-to-list ,alist-var (cons ,key ,value)))

(defmacro floobits--when-buf (buf &rest body)
  "Like `with-current-buffer' but check for existence of BUF,
plus widen and save excursion / restriction."
  (declare (indent defun))
  `(when ,buf
     (with-current-buffer ,buf
       (save-excursion
         (save-restriction
           (widen)
           ,@body)))))

(defun floobits-send-debug ()
  (when floobits-conn
