Skip to content

Commit

Permalink
fixup! Fix TRAMP issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Silex committed Apr 6, 2017
1 parent 0ef9963 commit f958fed
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions projectile.el
Expand Up @@ -863,9 +863,12 @@ 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."
;; The `is-local' and `is-connected' variables are used to fix the behavior where Emacs hangs
;; because of Projectile when you open a file over TRAMP. It basically prevents projectile from
;; trying to find information about files for which it's not possible to get informations from.
(let* ((dir default-directory)
(is-local (not (file-remote-p dir)))
(is-connected (file-remote-p dir nil t)))
(is-local (not (file-remote-p dir))) ;; `true' if the file is local
(is-connected (file-remote-p dir nil t))) ;; `true' if the file is remote AND we are connected to the remote
(or (when (or is-local is-connected)
(cl-some
(lambda (func)
Expand Down

0 comments on commit f958fed

Please sign in to comment.