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

Projectile is clearing other advices for compilation-find-file #871

Closed
caioaao opened this issue Sep 28, 2015 · 3 comments
Closed

Projectile is clearing other advices for compilation-find-file #871

caioaao opened this issue Sep 28, 2015 · 3 comments

Comments

@caioaao
Copy link

caioaao commented Sep 28, 2015

I have the following advice for the compilation-find-file:

(advice-add 'compilation-find-file  :around
              (lambda (oldfun &rest args)
                (destructuring-bind
                    (marker filename directory &rest formats) args
                  (apply oldfun marker
                         (w32utils-expand-subst filename)
                         (w32utils-expand-subst directory)
                         formats))))

All it does is expanding the path when I'm in Windows and using subst (more about it here), but when i have projectile-mode enabled in compilation directory, this advice is not being called. I'm a newbie on advising functions, but it looks like the way projectile does it's own advising breaks the other advices for this function. I've also read on Emacs Lisp Reference is obsolete. Could this error be related to some compatibility issues between defadvice and advice-add?

@caioaao caioaao changed the title Projectile is clearing other advices for compile-find-file Projectile is clearing other advices for compilation-find-file Sep 28, 2015
@bbatsov
Copy link
Owner

bbatsov commented Dec 25, 2015

I was under the impression you can have multiple advices for the same command. advice-add was added just recently and we can't leverage it in Projectile just yet.

@caioaao
Copy link
Author

caioaao commented Dec 29, 2015

You can, but since the projectile advices apparently overrides the find-file / compilation-find-file implementations (sometimes it doesn't call ad-do-it), the other advices may have no effect.

I've tested it with defadvice to make sure it wasn't a compatibility issue, and it also didn't work.

@caioaao
Copy link
Author

caioaao commented Dec 30, 2015

This patch seems to have fixed it, but I couldn't make cask work in Windows. I'll try running the tests later today and create the PR if successful.

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

No branches or pull requests

2 participants