anchor.diff:     (prompt-text
       "[restart prompt]"
       :type string
  -    :documentation "The prompt text debugger requires."))
  +    :documentation "The prompt text debugger requires.")
  +   (stack
  +    nil
  +    :documentation  "The state of call stack at the time of the condition firing.")
  +   (backtrace
  +    nil
  +    :documentation "The printed backtrace at the time of condition firing.
  +Prefer `stack', if present."))
     (:accessor-name-transformer (hu.dwim.defclass-star:make-name-transformer name))
     (:documentation "The wrapper for condition.
   
  
positive.code:         (remhash id *debug-conditions*)
          (buffer-delete debug-buffer)))))
  
  (defun debug->html (condition id &optional restarts)
    "Produce HTML code for the CONDITION with RESTARTS."
    (spinneret:with-html-string
      (:h* (symbol-name (type-of condition)))
      (:pre (format nil "~a" condition))
      (:section
       (loop for restart in restarts
             for i from 0
             collect (let ((restart restart))
                       (:button :class "button"
                                :onclick (ps:ps (nyxt/ps:lisp-eval
                                                 (:title "condition")
                                                 (calispel:! (channel (gethash id *debug-conditions*))
                                                             restart)))
                                (format nil "[~d] ~a" i (restart-name restart)))))
       (:h* "Backtrace")
       ;; TODO: SLIME and SLY provide introspectable backtraces. How?
       (:pre (with-output-to-string (s) (uiop:print-backtrace :stream s :condition condition))))))
  
  ;; FIXME: Not for interactive use?
  (define-internal-page-command open-debugger (&key id)
      ;; TODO: Introduce debug-mode with keys invoking restarts and toggling backtrace.
      (buffer (format nil "*Debug-~d*" id))
    "Open the debugger with the condition indexed by ID."
    (with-slots (condition-itself restarts channel)
        (gethash id *debug-conditions*)
      (declare (ignore channel))
      (debug->html condition-itself id restarts)))
  
  (define-command-global toggle-debug-on-error (&optional (value nil value-provided-p))
    "Toggle Nyxt-native debugging.
  
negative.code:            (handler (make-instance 'condition-handler
                                     :condition-itself condition
                                     :restarts restarts
                                     :channel channel
                                     :stack (dissect:stack)
                                     :backtrace (with-output-to-string (s)
                                                  (uiop:print-backtrace :stream s :condition condition))))
             (*interactive-p* t)
             (*query-io* (make-debugger-stream handler))
             (debug-buffer (open-debugger :id id)))
  