Comments (4)
Yeah, it depends a bit on the environment direnv
is passed. In envrc
, I always run direnv
in a default (non-direnv-produced) environment, so it will always re-calculate the new env, which can be costly (well, usually more than a few milliseconds). What happens with direnv.el
is that you are mostly passing the direnv
-augmented environment to direnv
, and when that environment contains DIRENV_MTIME
, DIRENV_WATCHES
etc., direnv
uses that to quickly yield a cached result where possible. I'll probably move to calling direnv
more frequently, anbd relying on its caching, but to do that I'll have to change how envrc
invokes DIRENV
, and effectively pass it the last-known env for a given direnv.
from emacs-direnv.
cc @purcell
from emacs-direnv.
Yeah, this makes sense to me: it would at least make the updates predictable.
from emacs-direnv.
i did some experimentation here.
direnv itself avoids running envrc already even if directories change (instead of blindly running and producing an empty diff), so it seems useless to try to be smart about that inside emacs, since direnv itself is already smart enough, and running direnv itself takes just a few milliseconds in those cases, which is fine to do once per buffer-switch.
(furthermore, using locate-dominating-file
adds i/o to the mix since it has to stat()
for potential .envrc
files up the directory tree, and when direnv
is executed it would just do the same again.)
from emacs-direnv.
Related Issues (20)
- release 1.5.0 HOT 2
- Caching strategies HOT 4
- direnv-mode tries to parse direnv errors HOT 5
- can make emacs hangs on kill-emacs
- add support for TRAMP HOT 5
- magit status doesn't trigger a direnv update HOT 2
- Not updating after upgrade HOT 1
- Code actually requires Emacs 26.1 HOT 1
- emacs-pytest does not use env variables set by direnv-mode HOT 1
- *Warnings* buffer pops up when .envrc is blocked HOT 3
- Python virtualenvwrapper HOT 6
- emacs not recognizing jupyter? HOT 2
- direnv environment carrying over between buffers HOT 2
- emacs-direnv breaks vterm prompt HOT 4
- direnv-emacs doesn't load soon enough and it breaks flycheck-haskell HOT 1
- Lots of these message "Invalid face reference: (diff-changed|dif-removed|diff-added) HOT 3
- Add to (Non)GNU ELPA? HOT 11
- error handling for blocked directories is annoying
- Feature: Disable updating environment for certain files/modes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emacs-direnv.