Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load dir-locals before switching project #1051

Merged
merged 2 commits into from
Sep 21, 2016
Merged

load dir-locals before switching project #1051

merged 2 commits into from
Sep 21, 2016

Conversation

ericdanan
Copy link
Contributor

@ericdanan ericdanan commented Sep 12, 2016

Modified function projectile-switch-project-by-name. Instead of calling switch-project-action from the current buffer, this is done in a temporary buffer after calling hack-dir-local-variables-non-file-buffer.

I think this fixes #413 and #1005 . It is the same solution I proposed there, but maybe easier to test for you with a PR.

Sorry I don't know how to add tests or make test. I don't think the changelog or readme should be updated since the function is not "visible".

Thanks


Before submitting a PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):

  • The commits are consistent with our contribution guidelines
  • You've added tests (if possible) to cover your change(s)
  • All tests are passing (make test)
  • The new code is not generating bytecode or M-x checkdoc warnings
  • You've updated the changelog (if adding/changing user-visible functionality)
  • You've updated the readme (if adding/changing user-visible functionality)

Thanks!

'projectile-commander
projectile-switch-project-action)))
(run-hooks 'projectile-before-switch-project-hook)
(funcall switch-project-action)
(with-temp-buffer
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add some comments explaining here the need for this.

'projectile-commander
projectile-switch-project-action)))
(run-hooks 'projectile-before-switch-project-hook)
(funcall switch-project-action)
(with-temp-buffer
(setq default-directory project-to-switch)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Messing with the default-directory is a very bad idea. Just let-bind it.

@ericdanan
Copy link
Contributor Author

Done, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

projectile-switch-project-action unsettable by .dir-locals.el
2 participants