anchor.diff:  is loaded.")
      (form
       nil
  +    :initarg nil
       :type (maybe function)
       :documentation "Function that returns HTML content when a nyxt:// URL is
   invoked.
   The nyxt:// URL query arguments are passed to this function as keyword arguments."))
  +  (:metaclass closer-mop:funcallable-standard-class)
     (:accessor-name-transformer (class*:make-name-transformer name))
  +  (:export-class-name-p t)
  +  (:export-accessor-names-p t)
     (:documentation "Each instance is a unique internal page generator for the
   nyxt:// URL scheme.
   
  -See `find-internal-page-buffer' and `define-internal-page'."))
  -
  -;; (defmethod initialize-instance :after ((page internal-page) &key)
  -;;   ())
  +Register a new nyxt:// URL under NAME.
  +When loaded, BODY is run to populate the page content.
  +
  +WARNING: Don't run anything sensitive in the BODY as any third-party page can
  +load nyxt:// URLs.
  +
  +BODY should end with a form returning the HTML body as a string.
  +
  +ARGLIST is arguments for the underlying page-generating
  +function. Any argument from it is safe to use in the body of this macro.
  +Beware: the ARGLIST should have nothing but keyword arguments because it's
  +mapped to the URL query parameters.
  +Only Lisp values that can be converted to JavaScript with
  +`webkit:lisp-to-jsc-value' are accepted.
  +
  +See `find-internal-page-buffer'."))
  +
  +(defmethod (setf form) (lambda-expression (page internal-page))
  +  (let ((arglist (second lambda-expression)))
  +    (multiple-value-bind (required optional rest keyword allow-other-keys-p aux key-p)
  +        (alex:parse-ordinary-lambda-list arglist)
  +      (declare (ignore allow-other-keys-p key-p))
  +      (when (or required optional rest aux)
  +        (error "Only keyword parameters are allowed in an internal-page definition."))
  +      (let* ((keyargs keyword))
  +        (setf (slot-value page 'form)
  +              (lambda (&rest args)
  +                (declare (ignorable args))
  +                (let ((*print-pretty* nil))
  +                  (values (spinneret:with-html-string
  +                            (:head
  +                             (:title (dynamic-title (gethash (name page) *nyxt-url-commands*)
  +                                                    keyargs))
  +                             (:style (style (current-buffer))))
  +                            (:body
  +                             (:raw (funcall (compile nil lambda-expression) args))))
  +                          "text/html;charset=utf8"))))))))
  +
  +(defmethod set-internal-page-method ((page internal-page) form)
  +  (when form
  +    (let* ((arglist (second form))
  +           (keywords (nth-value 3 (alex:parse-ordinary-lambda-list arglist)))
  +           (body (cddr form))
  +           (documentation (nth-value 2 (alex:parse-body body :documentation t))))
  +      (closer-mop:ensure-method
  +       page
  +       `(lambda (&rest args ,@arglist)
  +          ,@(when documentation (list documentation))
  +          (declare (ignorable ,@(alex:mappend #'cdar keywords)))
  +          (set-current-buffer
  +           (buffer-load (apply #'nyxt-url (name ,page) args)
  +                        :buffer (ensure-internal-page-buffer (name ,page)))))))))
  +
  +(defmethod initialize-instance :after ((page internal-page)
  +                                       &key form
  +                                       &allow-other-keys)
  +  "Register PAGE into the globally known nyxt:// URLs."
  +  (when form
  +    (set-internal-page-method page form)
  +    (setf (form page) form))
  +  (setf (gethash (name page) *nyxt-url-commands*) page))
   
   (defmethod dynamic-title ((page internal-page) &rest args)
     (with-slots ((title dynamic-title)) page
  
positive.code: (deftype internal-page-symbol ()
    `(and symbol (satisfies internal-page-symbol-p)))
  
  (define-class internal-page ()
    ((name
      nil
      :type symbol
      :export t
      :documentation "The key of the internal-page in `*nyxt-url-commands*'.")
     (dynamic-title ; Not `title' so that it does not clash with other `title' methods.
      ""
      :initarg :title
      :accessor nil
  
negative.code:                                             (ps:lisp style)))))))
  
  (sera:eval-always
    (defvar *nyxt-url-commands* (make-hash-table) ; TODO: Rename to `*internal-pages-command-list*'.
      "A map from allowed nyxt: URLs symbols to the functions that generate code of
    the pages related to these commands."))
  
  