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

Fix compilation-find-file advice handling of directory #1691

Merged
merged 1 commit into from
Aug 10, 2021

Conversation

DanielG
Copy link
Contributor

@DanielG DanielG commented Jul 8, 2021

compilation-mode keeps track of the "current" directory in the output by
matching on messages such as make's "Entering directory ...", when this
happens the 'directory' variable is set, but the current code just ignores
it when checking whether we should search across project directories or
not. This means that in cases when the filename is actually unambigous
relative to the given directory we'll still go off and try to find it all
over the project which is less than ideal.

Instead of re-implementing the correct directory logic here we refactor
compilation-find-file-projectile-find-compilation-buffer to locally append
our project directories to the the global compilation-search-path and let
the real compilation-find-file fun do it's thing.

While this makes the behaviour more consistent with the original fun it
does mean that now we always have to get all the project dirs which could
be quite involved in large projects. Previously we could elide this in the
"exits" case.


  • The commits are consistent with our contribution guidelines
  • You've added tests (if possible) to cover your change(s)
  • All tests are passing (eldev 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)
  • [ ]

compilation-mode keeps track of the "current" directory in the output by
matching on messages such as make's "Entering directory ...", when this
happens the 'directory' variable is set, but the current code just ignores
it when checking whether we should search across project directories or
not. This means that in cases when the filename is actually unambigous
relative to the given directory we'll still go off and try to find it all
over the project which is less than ideal.

Instead of re-implementing the correct directory logic here we refactor
compilation-find-file-projectile-find-compilation-buffer to locally append
our project directories to the the global compilation-search-path and let
the real compilation-find-file fun do it's thing.

While this makes the behaviour more consistent with the original fun it
does mean that now we always have to get all the project dirs which could
be quite involved in large projects. Previously we could elide this in the
"exits" case.
@bbatsov bbatsov merged commit 931c9d0 into bbatsov:master Aug 10, 2021
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.

2 participants