   "docstring")
 
 (defvar-local emdocs-after-change-lambda nil
+  "docstring")
+
+(defvar-local emdocs-before-change-lambda nil
+  "docstring")
+
+(defvar-local emdocs-undo-list nil
   "docstring")
 
 ;;; classes

  (with-current-buffer (if (bufferp buffer)
                           (buffer-name buffer)
                         buffer)
    (if (boundp 'emdocs-is-network-insert)
        (unless emdocs-is-network-insert
          (cond ((= prev-length 0)
                 (emdocs-emit-keypress-json
                  buffer "insert" beg (buffer-substring beg end)))
                ((= beg end)
                 (emdocs-emit-keypress-json
                  buffer "delete" beg prev-length)))))))

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

                     *emdocs-incoming-clients*))
    (setq-local after-change-functions
                (remove emdocs-after-change-lambda after-change-functions))
    (setq-local emdocs-after-change-lambda nil)
    (setq-local emdocs-undo-list nil)
    (setq-local before-change-functions
                (remove emdocs-before-change-lambda before-change-functions))
    (setq-local emdocs-before-change-lambda nil)))

(defun emdocs-kill-server ()
  "docstring"
