Coder Social home page Coder Social logo

Caching strategies about emacs-direnv HOT 4 CLOSED

wbolster avatar wbolster commented on May 26, 2024
Caching strategies

from emacs-direnv.

Comments (4)

wbolster avatar wbolster commented on May 26, 2024 1

direnv-mode is just one way of using this package. its goal is to always keep things in sync. caching seems to go against that goal.

direnv-update-environment is another way to use this package. it will modify the environment inside emacs once, and not automatically change anything until you invoke it again.

i'm not sure which problem you're trying to solve tbh, and whether this package is part of the solution :)

from emacs-direnv.

lassik avatar lassik commented on May 26, 2024 1

I wasn't trying to solve a concrete problem, just thinking out loud. I didn't realize you favor always being up-to-date over caching. It's a sound preference and if things are currently fast enough then there is no problem :)

from emacs-direnv.

lassik avatar lassik commented on May 26, 2024

Another option would be to have a global hash table mapping directory pathnames to their environment alists. This would avoid duplicate alists in files that are from the same directory. It would also transparently handle the case where a file is moved from one directory to another in dired while that file is open in a buffer. (The above buffer-local caching technique would be confused by that and keep using the environment from the old directory.)

In both cases there could be an explicit refresh command that the user could call, or refresh could be always done at intervals of 30 minutes, etc.

from emacs-direnv.

wbolster avatar wbolster commented on May 26, 2024

the technical complication is that direnv does not "set" the environment. it "transforms" it from one env to the other, including unsetting env vars. caching would complicate this a lot

from emacs-direnv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.