[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/exec-path-from-shell 9bc0f4a762 085/114: Note about how be
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/exec-path-from-shell 9bc0f4a762 085/114: Note about how best to set up shell config files |
Date: |
Tue, 5 Sep 2023 04:00:04 -0400 (EDT) |
branch: elpa/exec-path-from-shell
commit 9bc0f4a762f16d488376fb52409c58239a86d75d
Author: Steve Purcell <steve@sanityinc.com>
Commit: Steve Purcell <steve@sanityinc.com>
Note about how best to set up shell config files
---
README.md | 34 +++++++++++++++++++++-------------
1 file changed, 21 insertions(+), 13 deletions(-)
diff --git a/README.md b/README.md
index bb47925c07..82b1ea423c 100644
--- a/README.md
+++ b/README.md
@@ -2,14 +2,13 @@
[![Melpa Stable
Status](http://stable.melpa.org/packages/exec-path-from-shell-badge.svg)](http://stable.melpa.org/#/exec-path-from-shell)
<a href="https://www.patreon.com/sanityinc"><img alt="Support me"
src="https://img.shields.io/badge/Support%20Me-%F0%9F%92%97-ff69b4.svg"></a>
-exec-path-from-shell
-=====================
+# exec-path-from-shell
+
A GNU Emacs library to ensure environment variables inside Emacs look
the same as in the user's shell.
-Motivation
-----------
+## Motivation
Ever find that a command works in your shell, but not in Emacs?
@@ -20,8 +19,7 @@ This library solves this problem by copying important
environment
variables from the user's shell: it works by asking your shell to print out the
variables of interest, then copying them into the Emacs environment.
-Compatibility
--------------
+## Compatibility
If the path printed by evaluating `(getenv "SHELL")` in Emacs points at `bash`
or `zsh`, this should work fine.
@@ -39,8 +37,7 @@ Note that shell variables which have not been exported as
environment
variables (e.g. using the "export" keyword) may not be visible to
`exec-path-from-shell'.
-Installation
-------------
+## Installation
Installable packages are available via MELPA: do
`M-x package-install RET exec-path-from-shell RET`.
@@ -49,8 +46,7 @@ Alternatively, [download][]
the latest release or clone the repository, and install
`exec-path-from-shell.el` with `M-x package-install-file`.
-Usage
------
+## Usage
Add the following to your `init.el` (after calling `package-initialize`):
@@ -73,10 +69,12 @@ You can copy values of other environment variables by
customizing
This function may also be called interactively.
+### Setting up your shell startup files correctly
+
Note that your shell will inherit Emacs's environment variables when
-it is run -- to avoid surprises your config files should therefore
-set the environment variables to their exact desired final values,
-i.e. don't do this:
+it is run by `exec-path-from-shell` -- to avoid surprises your config
+files should therefore set the environment variables to their exact
+desired final values, i.e. don't do this:
```
export PATH=/usr/local/bin:$PATH
@@ -88,6 +86,16 @@ but instead do this:
export PATH=/usr/local/bin:/usr/bin:/bin
```
+You should also set your environment variables so that they are
+available to both interactive and non-interactive shells. In practical
+terms, for most people this means setting them in `~/.profile`,
+`~/.bash_profile`, `~/.zshenv` instead of `~/.bashrc` and
+`~/.zshrc`. By default, `exec-path-from-shell` checks for this
+mistake, at the cost of some execution time. If your config files are
+set up properly, you can set `exec-path-from-shell-arguments`
+appropriately (often to `nil`) before calling
+`exec-path-from-shell-initialize` to avoid this overhead.
+
Further help
------------
- [nongnu] elpa/exec-path-from-shell 869bc7ac48 050/114: Merge pull request #28 from emacs18/patch-1, (continued)
- [nongnu] elpa/exec-path-from-shell 869bc7ac48 050/114: Merge pull request #28 from emacs18/patch-1, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 30c793b388 054/114: Preserve "" env var values: don't map them to nil, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell eb4dda127e 056/114: Show which env vars are being set in the wrong startup files, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell c6eedaf916 071/114: Merge pull request #62 from Fuco1/patch-1, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 1d373ba14c 070/114: Fix defcustom for exec-path-from-shell-shell-name, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 5736cc87e4 075/114: Add sentinel to exec-path-from-shell-printf (closes #41), ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 885b3de9bb 078/114: Fix checkdoc warning, bogus local var, non-standard keywords, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 699f41edb3 087/114: Show error if trying to run from a remote buffer, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell e24dddb3b7 038/114: Capitalize MELPA, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 8748769a6c 042/114: Better "motivation" description, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 9bc0f4a762 085/114: Note about how best to set up shell config files,
ELPA Syncer <=
- [nongnu] elpa/exec-path-from-shell 76fbdf5d01 092/114: Fix ignore pattern in Actions YAML, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 6124001b69 101/114: Checkdoc fixes, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 4c3fbc3d7f 108/114: "docstring wider than 80 characters", ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 3a8d97c096 110/114: Show how I add NIX_PATH, SSH_AUTH_SOCK etc. to vars list, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell c2a727fe34 062/114: fix defcustom loading when env SHELL is empty, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 192c5341c5 044/114: Update MELPA URLs, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 18cad603c4 100/114: Mention applicability to running a daemon from systemd, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell ddd24dc823 113/114: Add Emacs 28.2 to CI, cut down size of matrix, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 30df5be792 064/114: Minor README fix, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 39755bf322 045/114: Use 'el' code block type rather than 'scheme', ELPA Syncer, 2023/09/05