anchor.diff:      (when (typep url 'nyxt::history-entry)
         (setf url (url url)))
       (add-modes-to-auto-mode-rules (url-infer-match url)
  -                                  :include (modes (current-buffer))
  +                                  :include (mapcar #'mode-invocation (modes (current-buffer)))
                                     :exact-p t)))
   
  -(declaim (ftype (function (list &key (:append-p boolean) (:exclude list)
  -                                (:include list) (:exact-p boolean))
  +(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)
  
positive.code: (defun auto-mode-handler (request-data)
    (with-data-lookup (history (history-path (buffer request-data)))
      (let* ((auto-mode (find-submode (buffer request-data) 'auto-mode))
             (previous-url
               (when (ignore-errors (htree:parent (htree:current-owner-node history)))
                 (url (htree:data (htree:parent (htree:current-owner-node history))))))
             (rule (matching-auto-mode-rule (url request-data) (buffer request-data)))
             (previous-rule (when previous-url (matching-auto-mode-rule previous-url (buffer request-data)))))
        (when (and rule previous-url (not previous-rule))
  
negative.code:          (enable-matching-modes (url request-data) (buffer request-data))))))
    request-data)
  
  (declaim (ftype (function (root-mode auto-mode boolean) list)
                  mode-covered-by-auto-mode-p))
  (defun mode-covered-by-auto-mode-p (mode auto-mode enable-p)
    (let ((invocation (mode-invocation mode)))
      (or (member invocation (non-rememberable-modes auto-mode)
                  :test #'equals)
          (let ((matching-rule (matching-auto-mode-rule
                                (url (buffer auto-mode))
                                (buffer auto-mode))))
            (member invocation (or (and matching-rule (union (included matching-rule)
                                                             (excluded matching-rule)))
                                   ;; Mode is covered by auto-mode only if it is
                                   ;; in last-active-modes and gets enabled.
                                   ;; If it gets disabled, user should be prompted,
                                   ;; because they may want to persist it.
                                   (and enable-p (last-active-modes auto-mode)))
                    :test #'equals)))))
  
  (declaim (ftype (function (string) list) url-infer-match))
  (defun url-infer-match (url)
  