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


Local bindings (`counsel-mode-map'):
\\{counsel-mode-map}"
    :group 'ivy
    :global t
    :keymap counsel-mode-map
    (el-patch-remove

        (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)
        (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)
        (advice-remove 'compilation-find-file #'compilation-find-file-projectile-find-compilation-buffer)
        (advice-remove 'delete-file #'delete-file-projectile-remove-from-cache)))))

  :init

