Skip to content

Commit

Permalink
[Fix #1005] Load dir-locals before switching project (#1051)
Browse files Browse the repository at this point in the history
Also fixes #413.
  • Loading branch information
ericdanan authored and bbatsov committed Sep 21, 2016
1 parent ddc77c2 commit 78ee7e3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions projectile.el
Original file line number Diff line number Diff line change
Expand Up @@ -2845,12 +2845,15 @@ With a prefix ARG invokes `projectile-commander' instead of
Invokes the command referenced by `projectile-switch-project-action' on switch.
With a prefix ARG invokes `projectile-commander' instead of
`projectile-switch-project-action.'"
(let* ((default-directory project-to-switch)
(switch-project-action (if arg
(let ((switch-project-action (if arg
'projectile-commander
projectile-switch-project-action)))
(run-hooks 'projectile-before-switch-project-hook)
(funcall switch-project-action)
;; use a temporary buffer to load PROJECT-TO-SWITCH's dir-locals before calling SWITCH-PROJECT-ACTION
(with-temp-buffer
(let ((default-directory project-to-switch))
(hack-dir-local-variables-non-file-buffer)
(funcall switch-project-action)))
(run-hooks 'projectile-after-switch-project-hook)))

;;;###autoload
Expand Down

0 comments on commit 78ee7e3

Please sign in to comment.