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

Show message when waiting for direnv #31

Closed
Mic92 opened this issue Dec 26, 2018 · 4 comments
Closed

Show message when waiting for direnv #31

Mic92 opened this issue Dec 26, 2018 · 4 comments

Comments

@Mic92
Copy link

Mic92 commented Dec 26, 2018

When loading some direnv environments that require to download packages,
in my example nix packages direnv currently blocks the editor without any indication why for the time of the download.
It would be therefore cool to show a message in order to see, where emacs currently blocks.

@Mic92
Copy link
Author

Mic92 commented Dec 26, 2018

Direnv itself already shows a message, when an environment takes longer then 5 seconds too load.

@wbolster
Copy link
Owner

i understand how this can be annoying.

currently direnv.el uses call-process (a synchronous api) to execute direnv export json:

(call-process "direnv" nil '(t t) nil "export" "json")

making that asynchronous using e.g. make-process would make things considerably more complex. not just the code, also all the state handling, e.g. what happens if direnv-mode is enabled, you switch to a buffer, direnv takes its time (in the background), you switch to another buffer from another directory in the mean time, direnv is triggered again, this time fast, the results get loaded, now the first direnv finally finished, even though you're not looking at that buffer anymore, oops, and so on, and so on.

i'd like to keep this library simple (and low maintenance) and changing this is not worth the complexity imho, though i do understand the inconvenience.

@wbolster
Copy link
Owner

closing this as ‘wontfix’ since it's too complex

@Mic92
Copy link
Author

Mic92 commented Aug 16, 2020

I started working on this issue, but I don't know how I can prevents direnv to be called multiple times in parallel for the same directory: Mic92@f4f3dbb
Also see this thread on NixOS discourse: https://discourse.nixos.org/t/emacs-direnv-help-needed-to-make-it-non-blocking/8595

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

No branches or pull requests

2 participants