[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/exec-path-from-shell 63a88bfb4f 055/114: Warn users if the
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/exec-path-from-shell 63a88bfb4f 055/114: Warn users if the "-i" arg makes a difference given their startup files |
Date: |
Tue, 5 Sep 2023 04:00:00 -0400 (EDT) |
branch: elpa/exec-path-from-shell
commit 63a88bfb4f2e5f9a7d915bbe6a0af3e71da6c2d7
Author: Steve Purcell <steve@sanityinc.com>
Commit: Steve Purcell <steve@sanityinc.com>
Warn users if the "-i" arg makes a difference given their startup files
---
exec-path-from-shell.el | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/exec-path-from-shell.el b/exec-path-from-shell.el
index 1847c678c8..a1f656b4d6 100644
--- a/exec-path-from-shell.el
+++ b/exec-path-from-shell.el
@@ -188,9 +188,19 @@ variables such as `exec-path'."
As a special case, if the variable is $PATH, then `exec-path' and
`eshell-path-env' are also set appropriately. The result is an alist,
as described by `exec-path-from-shell-getenvs'."
- (mapc (lambda (pair)
- (exec-path-from-shell-setenv (car pair) (cdr pair)))
- (exec-path-from-shell-getenvs names)))
+ (let ((pairs (exec-path-from-shell-getenvs names))
+ (without-minus-i (remove "-i" exec-path-from-shell-arguments)))
+
+ ;; If the user is using "-i", we warn them if it is necessary.
+ (unless (eq exec-path-from-shell-arguments without-minus-i)
+ (let* ((exec-path-from-shell-arguments without-minus-i)
+ (alt-pairs (exec-path-from-shell-getenvs names)))
+ (unless (equal pairs alt-pairs)
+ (warn "You appear to be setting environment variables in your
.bashrc or .zshrc: those files are only read by interactive shells, so you
should instead set environment variables in startup files like .bash_profile or
.zshenv. See the man page for your shell for more info. In future,
exec-path-from-shell will not read variables set in the wrong files."))))
+
+ (mapc (lambda (pair)
+ (exec-path-from-shell-setenv (car pair) (cdr pair)))
+ pairs)))
;;;###autoload
(defun exec-path-from-shell-copy-env (name)
- [nongnu] elpa/exec-path-from-shell 54f272f46e 024/114: Better docstrings, (continued)
- [nongnu] elpa/exec-path-from-shell 54f272f46e 024/114: Better docstrings, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell ab268a035a 026/114: Use the system-wide printf binary (if available) instead of shell built-in, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 1e51ae1f97 027/114: With tcsh, examine each variable with a separate shell invocation, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 3ff20e8d60 028/114: Update copyright year, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 49219e9425 029/114: Append exec-directory to exec-path, as is conventional, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 247683134a 035/114: Include shell output in debug messages, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 4f90eff044 039/114: Include shell output in error upon non-zero exit, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 54c1d4a0c6 047/114: Don't break if $SHELL is unset at load-time, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell e381af89a7 048/114: Note about inheriting of environment variables, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 4c328130ec 049/114: Remove unnecessary dash to appease old csh, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 63a88bfb4f 055/114: Warn users if the "-i" arg makes a difference given their startup files,
ELPA Syncer <=
- [nongnu] elpa/exec-path-from-shell 5836fb1656 066/114: Drop mention of marmalade, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 17fe8465cd 063/114: Merge pull request #44 from ksjogo/master, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 6be6e33bbe 057/114: Demote the warning to a message, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 731d805ed3 072/114: Also run exec-path-from-shell-initialize on Linux in example, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 5e355fbc50 076/114: Merge pull request #68 from timhillgit/master, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 20ad9805fd 077/114: Add Patreon badge, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 4d0af12747 081/114: Merge pull request #77 from jabranham/byte-compile, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell d8aa7765a1 084/114: Merge pull request #82 from mernst/installation-instructions, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 53ca76b97f 089/114: Link to flowbok article about shell startup files, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 3cfedb8791 088/114: Merge pull request #90 from lassik/error-if-remote, ELPA Syncer, 2023/09/05