anchor.diff:      (initialize-modes buffer)
       buffer))
   
  -(declaim (ftype (function (buffer)) rpc-buffer-delete))
   @export
   (defun rpc-buffer-delete (buffer)
     "Delete BUFFER from `*interface*'.
  -Run BUFFER's `buffer-delete-hook' over BUFFER before deleting it."
  +   Run BUFFER's `buffer-delete-hook' over BUFFER before deleting it."
     (next-hooks:run-hook (buffer-delete-hook buffer) buffer)
     (let ((parent-window (find-if
                           (lambda (window) (eql (active-buffer window) buffer))
                           (alexandria:hash-table-values (windows *interface*))))
           (replacement-buffer (or (%get-inactive-buffer)
                                   (rpc-buffer-make))))
  -    (%rpc-send "buffer_delete" (id buffer))
  +    ; (%rpc-send "buffer_delete" (id buffer))
       (when parent-window
         (window-set-active-buffer parent-window replacement-buffer))
       (remhash (id buffer) (buffers *interface*))
  
positive.code:     (gir:invoke (foreign-window-object 'show-all))
      window))
  
  (declaim (ftype (function (window string)) rpc-window-set-title))
  @export
  (defun rpc-window-set-title (window title)
    "Set the title for a given window."
    (%rpc-send "window_set_title" (id window) title))
  
  (declaim (ftype (function (window)) rpc-window-delete))
  @export
  (defun rpc-window-delete (window)
    "Delete a window object and remove it from the hash of windows.
  Once deleted, the `window-will-close' RPC endpoint will be called, running
  INTERFACE's `window-delete-hook' over WINDOW."
    (%rpc-send "window_delete" (id window)))
  
  @export
  (defun rpc-window-active ()
    "Return the window object for the currently active window."
    (let ((window (gethash (%rpc-send "window_active")
                           (windows *interface*))))
      (when window
        (setf (last-active-window *interface*) window))
      (last-active-window *interface*)))
  
  (declaim (ftype (function (window)) rpc-window-exists))
  @export
  (defun rpc-window-exists (window)
    "Return if a window exists."
    (%rpc-send "window_exists" (id window)))
  
  (declaim (ftype (function (window buffer)) rpc-window-set-active-buffer))
  @export
  (defun rpc-window-set-active-buffer (window buffer)
    "Set INTERFACE's WINDOW buffer to BUFFER.
  Run WINDOW's `window-set-active-buffer-hook' over WINDOW and BUFFER before
  proceeding."
    (next-hooks:run-hook (window-set-active-buffer-hook window) window buffer)
    (%rpc-send "window_set_active_buffer" (id window) (id buffer))
    (setf (active-buffer window) buffer)
    (when (and window buffer)
      (setf (last-active-buffer *interface*) buffer))
    buffer)
  
  (declaim (ftype (function (window integer)) rpc-window-set-minibuffer-height))
  @export
  (defun rpc-window-set-minibuffer-height (window height)
    (%rpc-send "window_set_minibuffer_height" (id window) height))
  
  (declaim (ftype (function (&key (:title string) (:default-modes list) (:dead-buffer buffer))) rpc-buffer-make))
  @export
  (defun rpc-buffer-make (&key title default-modes dead-buffer)
    "Make buffer with title TITLE and modes DEFAULT-MODES.
  
negative.code:               (key-chord-low-level-data event)
                (key-chord-position event))
               (id window))
    ;; (%rpc-send "generate_input_event"
    ;;            (id window)
    ;;            (key-chord-key-code event)
    ;;            (or (key-chord-modifiers event) (list ""))
    ;;            (key-chord-low-level-data event)
    ;;            (float (or (first (key-chord-position event)) -1.0))
    ;;            (float (or (second (key-chord-position event)) -1.0)))
    )
  
  @export
  (defun rpc-set-proxy (buffer &optional (proxy-uri "") (ignore-hosts (list nil)))
    "Redirect network connections of BUFFER to proxy server PROXY-URI.
     Hosts in IGNORE-HOSTS (a list of strings) ignore the proxy.
     For the user-level interface, see `proxy-mode'.
  
     Note: WebKit supports three proxy \"modes\": default (the system proxy),
     custom (the specified proxy) and none.
     TODO: We don't use \"none\" here, but it could be useful to expose it to the
     user."
    ;; (%rpc-send "set_proxy" (list (id buffer))
    ;;            (if (string= proxy-uri "")
    ;;                "default"
    ;;                "custom")
    ;;            proxy-uri ignore-hosts)
    )
  
  @export
  (defun rpc-get-proxy (buffer)
    "Return (MODE ADDRESS WHITELISTED-ADDRESSES...) of the active proxy
     configuration.
     MODE is one of \"default\" (use system configuration), \"custom\"
     or \"none\".
     ADDRESS is in the form PROTOCOL://HOST:PORT."
    ;(%rpc-send "get_proxy" (id buffer))
    )
  
  @export
  (defun rpc-buffer-set (buffer setting value)
    "Set SETTING to VALUE for BUFFER.
     Specification:
     https://webkitgtk.org/reference/webkit2gtk/stable/WebKitSettings.html."
    ;(%rpc-send "buffer_set" (id buffer) setting value)
    )
  