anchor.diff:          (let ((slice-size 10000))
             (reduce #'str:concat
                     (loop for i from 0 to (truncate (get-html-length)) by slice-size
  -                        collect (get-html i (+ i slice-size)))))))))
  -(define-ffi-generic ffi-generate-input-event (window event))
  -(define-ffi-generic ffi-generated-input-event-p (window event))
  +                        collect (get-html i (+ i slice-size))))))))
  +  (:documentation "Return the BUFFER raw HTML as a string."))
  +
  +(define-ffi-generic ffi-generate-input-event (window event)
  +  (:documentation "Send input EVENT to renderer for WINDOW.
  +This allows to programmatically generate events on demand.
  +EVENT are renderer-specific objects.
  +
  +The resulting should somehow be marked as generated, to allow Nyxt to tell
  +spontaneous events from programmed ones.
  +See also `ffi-generated-input-event-p'."))
  +
  +(define-ffi-generic ffi-generated-input-event-p (window event)
  +  (:documentation "Return non-nil if EVENT was generated by `ffi-generated-input-event'."))
  +
   (define-ffi-generic ffi-within-renderer-thread (browser thunk)
     (:method ((browser t) thunk)
       (declare (ignore browser))
  -    (funcall thunk)))
  -(define-ffi-generic ffi-kill-browser (browser))
  +    (funcall thunk))
  +  (:documentation "Run THUNK (a lambda of no argument) from the renderer's thread.
  +This is useful in particular for renderer-specific functions that cannot be run on random threads."))
  +
  +(define-ffi-generic ffi-kill-browser (browser)
  +  (:documentation "Terminate the renderer.
  +This often translates in the termination of the \"main loop\" associated to the widget engine."))
  +
   (define-ffi-generic ffi-initialize (browser urls startup-timestamp)
     (:method ((browser t) urls startup-timestamp)
  -    (finalize browser urls startup-timestamp)))
  -(define-ffi-generic ffi-inspector-show (buffer))
  -(define-ffi-generic ffi-print-status (window text))
  +    (finalize browser urls startup-timestamp))
  +  (:documentation "Renderer-specific initialization.
  +When done, call `call-next-method' to finalize the startup."))
  +
  +(define-ffi-generic ffi-inspector-show (buffer)
  +  (:documentation "Show the renderer built-in inspector."))
  +
  +(define-ffi-generic ffi-print-status (window text)
  +  (:documentation "Display TEST in the WINDOW status buffer."))
  +
   (define-ffi-generic ffi-print-message (window message)
  -  (:documentation "Print MESSAGE which is an HTML string."))
  -(define-ffi-generic ffi-display-url (text))
  +  (:documentation "Print MESSAGE (an HTML string) in the WINDOW message buffer."))
  +
  +(define-ffi-generic ffi-display-url (url)
  +  (:documentation "Return URL as a human-readable string.
  +In particular, this should understand Punycode."))
   
   (define-ffi-generic ffi-buffer-cookie-policy (buffer)
     (:documentation "Return the cookie 'accept' policy, one of of`:always',
  
positive.code:       ;; (trivial-clipboard:text (trivial-clipboard:text))
        (let ((input (%copy)))
          (copy-to-clipboard input)
          (echo "Text copied: ~s" input)))))
  (define-ffi-generic ffi-buffer-paste (buffer)
    (:method ((buffer t))
      (with-current-buffer buffer
        (%paste))))
  (define-ffi-generic ffi-buffer-cut (buffer)
    (:method ((buffer t))
      (with-current-buffer buffer
        (let ((input (%cut)))
          (when input
            (copy-to-clipboard input)
            (echo "Text cut: ~s" input))))))
  (define-ffi-generic ffi-buffer-select-all (buffer)
    (:method ((buffer t))
      (with-current-buffer buffer
        (%select-all))))
  (define-ffi-generic ffi-buffer-undo (buffer)
    (:method ((buffer t))
      (echo-warning "Undoing the edits is not yet implemented for this renderer.")))
  (define-ffi-generic ffi-buffer-redo (buffer)
    (:method ((buffer t))
      (echo-warning "Redoing the edits is not yet implemented for this renderer.")))
  
negative.code:                    (declare (ignore ,@(set-difference arguments lambda-list-keywords))))))
           ,@options-sans-methods))))
  
  (define-ffi-generic ffi-window-delete (window)
    (:documentation "Delete WINDOW, possibly freeing the associated widgets.
  After this call, the window should not be displayed."))
  
  (define-ffi-generic ffi-window-fullscreen (window))
  (define-ffi-generic ffi-window-unfullscreen (window))
  
  (define-ffi-generic ffi-buffer-url (buffer)
    (:documentation "Return the `quri:uri' associated with the BUFFER.
  This is used to set the `buffer' `url' slot."))
  (define-ffi-generic ffi-buffer-title (buffer)
    (:documentation "Return as a string the title of the document (or web page)
  showing in BUFFER."))
  
  (define-ffi-generic ffi-window-make (browser)
    (:method ((browser t))
      (declare (ignore browser))
      (make-instance 'window))
    (:documentation "Return a `window' object, ready for display.
  The renderer specialization must handle the widget initialization."))
  
  (define-ffi-generic ffi-window-to-foreground (window)
    (:method ((window t))
      (setf (slot-value *browser* 'last-active-window) window))
  