              (not emdocs-is-network-insert)
              (not emdocs-is-undo-insert)
              (/= beg end))
-    (let ((start-marker (make-marker))
-          (end-marker (make-marker)))
-      (set-marker start-marker beg)
-      (set-marker-insertion-type start-marker t)
-      (set-marker end-marker end)
-      (set-marker-insertion-type end-marker t)
-      (setq-local emdocs-undo-list emdocs-undo-posn)
-      (setq-local
-       emdocs-undo-list
-       (cons (list :type "delete" :start start-marker :end end-marker
-                   :content (buffer-substring-no-properties beg end)
-                   :local (not emdocs-is-network-insert))
-             emdocs-undo-list))
-      (setq-local emdocs-undo-posn emdocs-undo-list))))
+    (setq-local emdocs-undo-list emdocs-undo-posn)
+    (setq-local
+     emdocs-undo-list
+     (cons (list :type "delete" :start asdf :end asdf
+                 :content (buffer-substring-no-properties beg end)
+                 :local (not emdocs-is-network-insert))
+           emdocs-undo-list))
+    (setq-local emdocs-undo-posn emdocs-undo-list)))
 
 (defun emdocs-undo ()
   "docstring"

                   finally (return cur-undo-el))))
        (if (not emdocs-undo-target)
            (message "No more redo information available!")
          (let ((undo-edit (car emdocs-undo-target)))
            (cond ((string-equal (plist-get undo-edit :type) "insert")
                   (goto-char (plist-get undo-edit :start))
                   (insert (plist-get undo-edit :content))
                   (set-marker (plist-get undo-edit :end)
                               (+ (plist-get undo-edit :start)
                                  (length (plist-get undo-edit :content)))))
                  ((string-equal (plist-get undo-edit :type) "delete")
                   (delete-region (plist-get undo-edit :start)
                                  (plist-get undo-edit :end))))
            (setq-local emdocs-undo-posn emdocs-undo-target))))
    (setq-local emdocs-is-undo-insert nil)))

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

           :content content))
    "\n")))

(defun emdocs-explode-undo-list ()
  (setq emdocs-undo-list nil)
  (setq emdocs-undo-posn nil))

