                          buffer)
     (when (= prev-length 0)
       (setq-local emdocs-undo-list
-                  (cons `(:type ,"insert" :point ,beg
-                          :content ,(buffer-substring-no-properties beg end)
-                          :local ,(not emdocs-is-network-insert))
+                  (cons (list :type "insert" :point beg :end end
+                              :content (buffer-substring-no-properties beg end)
+                              :local (not emdocs-is-network-insert))
                         emdocs-undo-list)))
     (when (and (boundp 'emdocs-is-network-insert)
                (not emdocs-is-network-insert))

  (emdocs-broadcast-message
   (concat
    (json-encode
     `(:buffer ,(if (bufferp buffer)
                    (buffer-name buffer)
                  buffer)
       :edit_type ,type
       :point ,point
       :content ,content))
    "\n")))

(defun emdocs-after-change-function (buffer beg end prev-length)

       sock
       (concat
        (json-encode
         (list :buffer (emdocs-get-attached-buffer client)
               :ip (emdocs-get-internal-ip-address)))
        "\n"))
    (let* ((json-object-type 'plist)
           (json-msg (json-read-from-string msg))
