[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/exec-path-from-shell 673f1fc060 058/114: Better warning me
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/exec-path-from-shell 673f1fc060 058/114: Better warning message, and allow the check to be suppressed |
Date: |
Tue, 5 Sep 2023 04:00:00 -0400 (EDT) |
branch: elpa/exec-path-from-shell
commit 673f1fc0606ca9a30eb62cb1ac2094d15ab9377e
Author: Steve Purcell <steve@sanityinc.com>
Commit: Steve Purcell <steve@sanityinc.com>
Better warning message, and allow the check to be suppressed
---
exec-path-from-shell.el | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/exec-path-from-shell.el b/exec-path-from-shell.el
index 8e72442e01..dbf89a8270 100644
--- a/exec-path-from-shell.el
+++ b/exec-path-from-shell.el
@@ -82,6 +82,13 @@
:type '(repeat (string :tag "Environment variable"))
:group 'exec-path-from-shell)
+(defcustom exec-path-from-shell-check-startup-files t
+ "If non-nil, warn if variables are being set in the wrong shell startup
files.
+Environment variables should be set in .profile or .zshenv rather than
+.bashrc or .zshrc."
+ :type 'boolean
+ :group 'exec-path-from-shell)
+
(defvar exec-path-from-shell-debug nil
"Display debug info when non-nil.")
@@ -189,7 +196,8 @@ 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'."
(let ((pairs (exec-path-from-shell-getenvs names)))
- (exec-path-from-shell--maybe-warn-about-startup-files pairs)
+ (when exec-path-from-shell-check-startup-files
+ (exec-path-from-shell--maybe-warn-about-startup-files pairs))
(mapc (lambda (pair)
(exec-path-from-shell-setenv (car pair) (cdr pair)))
pairs)))
@@ -206,7 +214,7 @@ as described by `exec-path-from-shell-getenvs'."
(unless (equal pair (assoc (car pair) alt-pairs))
(push (car pair) different)))
(when different
- (message "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))))))
+ (message "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 .profile,
.bash_profile or .zshenv. Refer to your shell's man page for more info.
Customize `exec-path-from-shell-arguments' to remove \"-i\" when done, or
disable `exec-path-from-shell-check-startup-files' to disable this message."
different))))))
;;;###autoload
(defun exec-path-from-shell-copy-env (name)
- [nongnu] elpa/exec-path-from-shell e88cce5a93 067/114: Fix checkdoc warnings, (continued)
- [nongnu] elpa/exec-path-from-shell e88cce5a93 067/114: Fix checkdoc warnings, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 51d0931c2a 003/114: Improve suggested condition for initialization on OS X, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 900d98a912 005/114: Improve docstrings, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 1115e59539 033/114: Provide better info when the shell doesn't printf vars as expected, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell ad5eda1649 034/114: Require non-zero exit code, and allow debug output, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 345ba9cb71 036/114: Don't fail when printing undefined vars if shell -e option is set, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell b09a42885c 037/114: tcsh doesn't support the ${VAR-default} syntax, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell e4af0e9b44 043/114: Add MELPA badges, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell ba09c3419f 046/114: Note necessity of calling `package-initialize` (closes #19), ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell bb20b46f6a 051/114: Treat csh like tcsh (closes #29), ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 673f1fc060 058/114: Better warning message, and allow the check to be suppressed,
ELPA Syncer <=
- [nongnu] elpa/exec-path-from-shell 5e80a4159b 059/114: Use a more sane package version placeholder, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell c2ca275d32 061/114: Clarify incompatibility with cmdproxy.exe et al, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 9700a076a9 065/114: Merge pull request #45 from jlandahl/master, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 15d07666fb 074/114: Merge pull request #65 from belak/also-run-on-linux, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell fedb500652 073/114: Fix "Emacssenvironment" typo, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 9def990ba4 069/114: Allow shell to be set explicitly, and change default resolution rules, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 5c44eabbb0 080/114: Declare a variable for the byte compiler, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 54ea2f9c3c 082/114: Make clear that bash and zsh are particularly supported, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 7e7f381884 091/114: Use a better method to establish definition of eshell-path-env, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 1a43e8aea5 090/114: Add simple CI with Actions, ELPA Syncer, 2023/09/05