Refactor doom core files

This commit is contained in:
Henrik Lissner 2018-09-07 21:43:32 -04:00
parent 49e6e68a07
commit 57579b883b
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
7 changed files with 86 additions and 84 deletions

View file

@ -47,18 +47,18 @@
;; Projectile root-searching functions can cause an infinite loop on TRAMP
;; connections, so disable them.
(defun doom*projectile-locate-dominating-file (orig-fn &rest args)
(defun doom*projectile-locate-dominating-file (orig-fn file name)
"Don't traverse the file system if on a remote connection."
(unless (file-remote-p default-directory)
(apply orig-fn args)))
(funcall orig-fn file name)))
(advice-add #'projectile-locate-dominating-file :around #'doom*projectile-locate-dominating-file)
(defun doom*projectile-cache-current-file (orig-fun &rest args)
(defun doom*projectile-cache-current-file (orig-fn)
"Don't cache ignored files."
(unless (cl-loop for path in (projectile-ignored-directories)
if (string-prefix-p (or buffer-file-name "") (expand-file-name path))
return t)
(apply orig-fun args)))
(funcall orig-fn)))
(advice-add #'projectile-cache-current-file :around #'doom*projectile-cache-current-file))