{"id":13443125,"url":"https://github.com/purcell/inheritenv","last_synced_at":"2025-04-11T05:43:50.204Z","repository":{"id":40568524,"uuid":"334807196","full_name":"purcell/inheritenv","owner":"purcell","description":"Make emacs temp buffers inherit buffer-local environment variables","archived":false,"fork":false,"pushed_at":"2024-11-19T13:55:42.000Z","size":15,"stargazers_count":47,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T03:31:27.889Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/purcell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"sanityinc"}},"created_at":"2021-02-01T02:24:25.000Z","updated_at":"2025-03-21T01:55:51.000Z","dependencies_parsed_at":"2024-11-07T08:21:08.984Z","dependency_job_id":"ff024305-3041-4c26-a6eb-25129b7b7d8f","html_url":"https://github.com/purcell/inheritenv","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purcell%2Finheritenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purcell%2Finheritenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purcell%2Finheritenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purcell%2Finheritenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/purcell","download_url":"https://codeload.github.com/purcell/inheritenv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248351457,"owners_count":21089271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T03:01:56.443Z","updated_at":"2025-04-11T05:43:50.175Z","avatar_url":"https://github.com/purcell.png","language":"Emacs Lisp","readme":"[![Melpa Status](http://melpa.org/packages/inheritenv-badge.svg)](http://melpa.org/#/inheritenv)\n[![Melpa Stable Status](http://stable.melpa.org/packages/inheritenv-badge.svg)](http://stable.melpa.org/#/inheritenv)\n[![Build Status](https://github.com/purcell/inheritenv/actions/workflows/ci.yml/badge.svg)](https://github.com/purcell/inheritenv/actions/workflows/ci.yml)\n\u003ca href=\"https://www.patreon.com/sanityinc\"\u003e\u003cimg alt=\"Support me\" src=\"https://img.shields.io/badge/Support%20Me-%F0%9F%92%97-ff69b4.svg\"\u003e\u003c/a\u003e\n\n# Make Emacs temp buffers inherit buffer-local environment variables\n\nEnvironment variables in Emacs can be set buffer-locally, like many\nEmacs preferences, and this allows users to have different buffer-local\npaths for executables in different projects, specified by a\n`.dir-locals.el` file or via a `direnv` integration like\n[envrc](https://github.com/purcell/envrc).\n\nHowever, there's a fairly common pitfall when Emacs libraries run\nbackground processes on behalf of a user: many such libraries run\nprocesses in temporary buffers that do not inherit the calling\nbuffer's environment if it is set buffer-locally.\nThis can result in executables not being found,\nor the wrong versions of executables being picked up.\n\nAn example is the Emacs built-in command\n`shell-command-to-string`. Whatever buffer-local `process-environment`\n(or `exec-path`) the user has set, that command will always use the\nEmacs-wide default. This is *specified* behaviour, but not *expected*\nor *helpful*.\n\n`inheritenv` provides a couple of tools for dealing with this\nissue:\n\n1. Library authors can wrap code that plans to execute processes in\n   temporary buffers with the `inheritenv` macro.\n2. Users can modify commands like `shell-command-to-string` using the\n   `inheritenv-add-advice` macro.\n\n## Installation\n\n### Manual\n\nEnsure `inheritenv.el` is in a directory on your load-path, and add\nthe following to your `~/.emacs` or `~/.emacs.d/init.el`:\n\n```elisp\n(require 'inheritenv)\n```\n\n### MELPA\n\nIf you're an Emacs 24 user or you have a recent version of\n`package.el` you can install `inheritenv` from the\n[MELPA](http://melpa.org) repository. The version of\n`inheritenv` there will always be up-to-date.\n\n## About\n\nAuthor: Steve Purcell \u003csteve at sanityinc dot com\u003e\n\nHomepage: https://github.com/purcell/inheritenv\n\n\u003chr\u003e\n\n[💝 Support this project and my other Open Source work](https://www.patreon.com/sanityinc)\n\n[💼 LinkedIn profile](https://uk.linkedin.com/in/stevepurcell)\n\n[✍ sanityinc.com](https://www.sanityinc.com/)\n","funding_links":["https://patreon.com/sanityinc","https://www.patreon.com/sanityinc"],"categories":["Emacs Lisp"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurcell%2Finheritenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpurcell%2Finheritenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurcell%2Finheritenv/lists"}