From 5e6fc7e4ef85ae241c4a99e191acea7d3835ed7d Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sat, 12 Apr 2025 14:58:59 +0200 Subject: [PATCH] fix: do not set up shell env when EMACS_NO_SHELL_ENV is set --- init.el | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/init.el b/init.el index 21c6dfc..f82cbea 100644 --- a/init.el +++ b/init.el @@ -165,33 +165,33 @@ ;; (lambda (&rest args) (my/adjust-shift-widths ,variable)))) ;; ENV -(unless (getenv "EMACS_NO_SHELL_ENV") - (my-use-package exec-path-from-shell - :ensure t - :demand t - :custom - (exec-path-from-shell-shell-name (getenv "SHELL")) +(my-use-package exec-path-from-shell + :ensure t + :demand t + :custom + (exec-path-from-shell-shell-name (getenv "SHELL")) ; (exec-path-from-shell-arguments "-l -i") ; Set by default for bash, zsh etc. - (exec-path-from-shell-variables - '("PATH" - "MANPATH" - "INFOPATH" - "CXX" - "CC" - "XDG_CONFIG_HOME" - "XDG_CACHE_HOME" - "XDG_DATA_HOME" - "NIX_PATH" - "GUILE_LOAD_PATH" - "GUILE_LOAD_COMPILED_PATH")) - :config - (setenv "SHLVL" "0") - (unless (memq system-type '(windows-nt android)) - (exec-path-from-shell-initialize)) - ;; This is for Matlab + my WM without reparenting. - ;; This cannot be sourced from the env, as the script that adds - ;; this environment, is not part of shell initialization - (setenv "_JAVA_AWT_WM_NONREPARENTING" "1"))) + (exec-path-from-shell-variables + '("PATH" + "MANPATH" + "INFOPATH" + "CXX" + "CC" + "XDG_CONFIG_HOME" + "XDG_CACHE_HOME" + "XDG_DATA_HOME" + "NIX_PATH" + "GUILE_LOAD_PATH" + "GUILE_LOAD_COMPILED_PATH")) + :config + (setenv "SHLVL" "0") + (unless (or (memq system-type '(windows-nt android)) (getenv "EMACS_NO_SHELL_ENV")) + (message "Setting up environment from shell") + (exec-path-from-shell-initialize)) + ;; This is for Matlab + my WM without reparenting. + ;; This cannot be sourced from the env, as the script that adds + ;; this environment, is not part of shell initialization + (setenv "_JAVA_AWT_WM_NONREPARENTING" "1")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -- 2.48.1