         (add-hook 'find-file-hook 'projectile-find-file-hook-function)
         (add-hook 'projectile-find-dir-hook #'projectile-track-known-projects-find-file-hook t)
         (add-hook 'dired-before-readin-hook #'projectile-track-known-projects-find-file-hook t t)
-        (ad-activate 'compilation-find-file)
-        (ad-activate 'delete-file)))
+        (advice-add 'compilation-find-file :around #'compilation-find-file-projectile-find-compilation-buffer)
+        (advice-add 'delete-file :before #'delete-file-projectile-remove-from-cache)))
      (el-patch-remove
        (t
         (remove-hook 'find-file-hook #'projectile-find-file-hook-function)
         (remove-hook 'dired-before-readin-hook #'projectile-track-known-projects-find-file-hook t)
-        (ad-deactivate 'compilation-find-file)
-        (ad-deactivate 'delete-file)))))
+        (advice-remove 'compilation-find-file #'compilation-find-file-projectile-find-compilation-buffer)
+        (advice-remove 'delete-file #'delete-file-projectile-remove-from-cache)))))
 
   :init
 

        "\n\nSupport for searching compressed files and for
reporting results in a deterministic order has been added by
`el-patch'."))
    :type 'string
    :group 'ivy)

  :blackout t)


        ;; Check if we should cancel the timer.
        (when (and (not global-auto-revert-mode)
                   (null auto-revert-buffer-list))
          (if (timerp auto-revert-timer)
              (cancel-timer auto-revert-timer))
          (setq auto-revert-timer nil)))))

  :config
