Skip to content

Commit

Permalink
Fix tramp issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Silex committed Mar 23, 2017
1 parent 0c307c8 commit d783c69
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions projectile.el
Expand Up @@ -863,17 +863,20 @@ topmost sequence of matched directories. Nil otherwise."
(defun projectile-project-root ()
"Retrieves the root directory of a project if available.
The current directory is assumed to be the project's root otherwise."
(let ((dir default-directory))
(or (cl-some
(lambda (func)
(let* ((cache-key (format "%s-%s" func dir))
(cache-value (gethash cache-key projectile-project-root-cache)))
(if (and cache-value (file-exists-p cache-value))
cache-value
(let ((value (funcall func (file-truename dir))))
(puthash cache-key value projectile-project-root-cache)
value))))
projectile-project-root-files-functions)
(let* ((dir default-directory)
(is-local (not (file-remote-p dir)))
(is-connected (file-remote-p default-directory nil t)))
(or (when (or is-local is-connected)
(cl-some
(lambda (func)
(let* ((cache-key (format "%s-%s" func dir))
(cache-value (gethash cache-key projectile-project-root-cache)))
(if (and cache-value (file-exists-p cache-value))
cache-value
(let ((value (funcall func (file-truename dir))))
(puthash cache-key value projectile-project-root-cache)
value))))
projectile-project-root-files-functions))
(if projectile-require-project-root
(error "You're not in a project")
default-directory))))
Expand Down Expand Up @@ -3475,9 +3478,7 @@ is chosen."

;;;###autoload
(defcustom projectile-mode-line
'(:eval (if (file-remote-p default-directory)
" Projectile"
(format " Projectile[%s]" (projectile-project-name))))
'(:eval (format " Projectile[%s]" (projectile-project-name)))
"Mode line lighter for Projectile.
The value of this variable is a mode line template as in
Expand Down

0 comments on commit d783c69

Please sign in to comment.