rejeep / prodigy.el

Manage external services from within Emacs
GNU General Public License v3.0
550 stars 39 forks source link

Add post-command-hook locally #126

Closed xuchunyang closed 4 years ago

xuchunyang commented 4 years ago

It seems prodigy-set-default-directory is no use outside the prodigy buffer.

rejeep commented 4 years ago

I'm not sure exactly what this would mean in practice? Also, I don't use the hook so it's difficult for me to verify.

xuchunyang commented 4 years ago

The hook is added once you have invoked M-x prodigy. Since it's not added locally, prodigy-set-default-directory will be called even you're outside the *prodigy* buffer.

How to reproduce:

  1. M-x prodigy and kill the buffer *prodigy*
  2. C-h v post-command-hook and you should notice prodigy-set-default-directory is in the global value
rejeep commented 4 years ago

Ahh, now I see what you mean. I was a bit quick the first time and thought this was a mode hook for Prodigy. I also see that prodigy-set-default-directory checks the major mode, so it shouldn't be that much of an issue, but I agree it's better to not pollute the global state.

I added you as a collaborator, so feel free to merge.

Thanks! 👍

xuchunyang commented 4 years ago

Thanks. I notice the travis ci is failing but it's a Cask issue, so I've merged this pr.

Fuco1 commented 4 years ago

I think the hook is ment to re-set the default directory when you change the active row (iow set it to that process's dd). :+1: