                 ((= beg end)
                  (emdocs-emit-keypress-json
                   buffer "delete" beg prev-length)))))))
-
-(defvar-local emdocs-initial-client nil
-  "docstring")
-
-(defvar-local emdocs-ip-addr nil
-  "docstring")
-
-(defvar-local emdocs-is-network-insert nil
-  "docstring")
-
-(defvar-local emdocs-after-change-lambda nil
-  "docstring")
 
 (defun emdocs-attach-sockets-to-buffer (buffer ip)
   "docstring"

(defvar *emdocs-incoming-clients* nil
  "docstring")

;;; classes

(defclass emdocs-client ()
  ((process
    :initarg :process
    :accessor emdocs-get-process)
   (attached-buffer
    :initarg :attached-buffer
    :accessor emdocs-get-attached-buffer)
   (ip
    :initarg :ip
    :accessor emdocs-get-ip)))

;;; functions

;;; utility
(defun emdocs-get-internal-ip-address (&optional device-name)
  "Returns ip address of active interface, ignoring loopback. Returns nil if
none active. Returns an arbitrary interface if more than one is connected."
  (if device-name
      (format-network-address (car (network-interface-info device-name)) t)
    (let ((network-interfaces (network-interface-list)))

;; -*- lexical-binding: t; -*-

;;; requires

(eval-when-compile
  (require 'cl)
