emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/exec-path-from-shell eb4dda127e 056/114: Show which env va


From: ELPA Syncer
Subject: [nongnu] elpa/exec-path-from-shell eb4dda127e 056/114: Show which env vars are being set in the wrong startup files
Date: Tue, 5 Sep 2023 04:00:00 -0400 (EDT)

branch: elpa/exec-path-from-shell
commit eb4dda127ea51adc0822c1e2fd9c23aa61f53a45
Author: Steve Purcell <steve@sanityinc.com>
Commit: Steve Purcell <steve@sanityinc.com>

    Show which env vars are being set in the wrong startup files
---
 exec-path-from-shell.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/exec-path-from-shell.el b/exec-path-from-shell.el
index a1f656b4d6..315b0d3683 100644
--- a/exec-path-from-shell.el
+++ b/exec-path-from-shell.el
@@ -194,9 +194,13 @@ as described by `exec-path-from-shell-getenvs'."
     ;; 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."))))
+             (alt-pairs (exec-path-from-shell-getenvs names))
+             different)
+        (dolist (pair pairs)
+          (unless (equal pair (assoc (car pair) alt-pairs))
+            (push (car pair) different)))
+        (when different
+          (warn "You appear to be setting environment variables %S 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.  Refer to your shell's man page for more info.  In future, 
exec-path-from-shell will not read variables set in the wrong files." 
different))))
 
     (mapc (lambda (pair)
             (exec-path-from-shell-setenv (car pair) (cdr pair)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]