remove project-root-of-file

This commit is contained in:
Ivan Malison 2016-03-16 19:18:55 -07:00
parent 74620118ab
commit 2a1671a6b3

View File

@ -473,30 +473,6 @@ buffer is not visiting a file."
(cond ((eq system-type 'darwin) 'notification-center)
((eq system-type 'gnu/linux) 'notify-send)))
(defun project-root-of-file (filename)
"Retrieves the root directory of a project if available.
The current directory is assumed to be the project's root otherwise."
(file-truename
(let ((dir (file-truename filename)))
(or (--reduce-from
(or acc
(let* ((cache-key (format "%s-%s" it dir))
(cache-value (gethash cache-key
projectile-project-root-cache)))
(if cache-value
(if (eq cache-value 'no-project-root)
nil
cache-value)
(let ((value (funcall it dir)))
(puthash cache-key (or value 'no-project-root)
projectile-project-root-cache)
value))))
nil
projectile-project-root-files-functions)
(if projectile-require-project-root
(error "You're not in a project")
default-directory)))))
;; =============================================================================
;; General Emacs Options
;; =============================================================================