anchor.diff:  
   (defun save-last-active-modes (auto-mode url)
     (when (can-save-last-active-modes auto-mode url)
  -    ;; `last-active-modes' must be a list separate from the mode list, otherwise
  -    ;; when modes get modified, last-active-modes would also be altered.
  -    (setf (last-active-modes auto-mode) (copy-list (modes (buffer auto-mode)))
  +    (setf (last-active-modes auto-mode) (mapcar #'mode-invocation (modes (buffer auto-mode)))
             (last-active-modes-url auto-mode) url)))
   
   (defun reapply-last-active-modes (auto-mode)
     (disable-modes
  -   (mapcar #'maybe-mode-name
  -           (set-difference (modes (buffer auto-mode))
  +   (mapcar #'name
  +           (set-difference (mapcar #'mode-invocation (modes (buffer auto-mode)))
                              (last-active-modes auto-mode)
  -                           :test #'mode-equal))
  +                           :test #'equals))
      (buffer auto-mode))
     (enable-modes
  -   (mapcar #'maybe-mode-name
  +   (mapcar #'name
              (set-difference (last-active-modes auto-mode)
  -                           (modes (buffer auto-mode))
  -                           :test #'mode-equal))
  +                           (mapcar #'mode-invocation (modes (buffer auto-mode)))
  +                           :test #'equals))
      (buffer auto-mode)))
   
   (defun new-page-request-p (request-data)
  
positive.code:                 make-mode-toggle-prompting-handler))
  (defun make-mode-toggle-prompting-handler (enable-p auto-mode)
    #'(lambda (mode)
        (when (not (mode-covered-by-auto-mode-p mode auto-mode enable-p))
          (if-confirm ("Permanently ~:[disable~;enable~] ~a for this URL?"
                         enable-p (mode-name mode))
                      (let ((url (prompt-minibuffer
                                  :input-prompt "URL:"
                                  :input-buffer (object-display (url (buffer mode)))
                                  :must-match-p nil)))
              (add-modes-to-auto-mode-rules (url-infer-match url)
                                            :append-p t
                                            :include (when enable-p (list mode))
                                            :exclude (unless enable-p (list mode))))
            (setf (last-active-modes auto-mode)
                  (if enable-p
                      (union (list mode) (last-active-modes auto-mode)
                             :test #'mode-equal)
                      (remove mode (last-active-modes auto-mode)
                              :test #'mode-equal)))))))
  
  (defun initialize-auto-mode (mode)
    (unless (last-active-modes mode)
      (setf (last-active-modes mode)
            (default-modes (buffer mode))))
    (when (prompt-on-mode-toggle mode)
      (hooks:add-hook (enable-mode-hook (buffer mode))
                      (nyxt::make-handler-mode
  
negative.code:     (when (typep url 'nyxt::history-entry)
        (setf url (url url)))
      (add-modes-to-auto-mode-rules (url-infer-match url)
                                    :include (mapcar #'mode-invocation (modes (current-buffer)))
                                    :exact-p t)))
  
  (declaim (ftype (function (list &key (:append-p boolean) (:exclude (or (cons mode-invocation *) null))
                                  (:include (or (cons mode-invocation *) null)) (:exact-p boolean))
                            (values list &optional))
                  add-modes-to-auto-mode-rules))
  (sera:export-always 'add-modes-to-auto-mode-rules)
  