   "docstring"
   (unless (string-equal ip (emdocs-get-internal-ip-address))
     (let ((new-client (make-instance 'emdocs-client
-                                   :attached-buffer (if (bufferp buffer)
-                                                       (buffer-name buffer)
-                                                     buffer)
-                                   :ip ip)))
+                                     :attached-buffer buffer
+                                     :ip ip)))
       (emdocs-set-process new-client
                           (make-network-process
                            :name (emdocs-get-client-process-name buffer ip)

           (emdocs-emit-keypress-json
            (buffer-name) "delete" beg prev-length))))
  (unless emdocs-is-network-insert
    (setq-local emdocs-undo-posn emdocs-undo-list)))

(defun emdocs-before-change-function (beg end)
  "docstring"

(defun emdocs-undo ()
  "docstring"
  (interactive)
  (setq-local emdocs-is-undo-insert t)
  (unwind-protect
      (throw 'wreckage t)
    (setq-local emdocs-is-undo-insert nil)))

(defun emdocs-attach-to-buffer (buffer ip)
  "docstring"
