From 344bea79fc08baccffb5f99453693f59da55948d Mon Sep 17 00:00:00 2001 From: Dominik Kellner Date: Wed, 16 Oct 2019 18:11:05 +0200 Subject: [PATCH 1/2] Prevent `eshell-path-env` getting out-of-sync with $PATH --- direnv.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/direnv.el b/direnv.el index af7f54d..2ec3b02 100644 --- a/direnv.el +++ b/direnv.el @@ -227,7 +227,10 @@ When FORCE-SUMMARY is non-nil or when called interactively, show a summary messa (value (cdr pair))) (setenv name value) (when (string-equal name "PATH") - (setq exec-path (append (parse-colon-path value) (list exec-directory)))))))) + (setq exec-path (append (parse-colon-path value) (list exec-directory))) + ;; Prevent `eshell-path-env` getting out-of-sync with $PATH: + (when (eq major-mode 'eshell-mode) + (setq eshell-path-env value))))))) ;;;###autoload (defun direnv-allow () From 8d01c7b91549ccbdf5320b73ee280bf87ffecd88 Mon Sep 17 00:00:00 2001 From: wouter bolsterlee Date: Wed, 16 Oct 2019 20:56:10 +0200 Subject: [PATCH 2/2] use derived-mode-p to check current major mode --- direnv.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direnv.el b/direnv.el index 2ec3b02..ec94a73 100644 --- a/direnv.el +++ b/direnv.el @@ -229,7 +229,7 @@ When FORCE-SUMMARY is non-nil or when called interactively, show a summary messa (when (string-equal name "PATH") (setq exec-path (append (parse-colon-path value) (list exec-directory))) ;; Prevent `eshell-path-env` getting out-of-sync with $PATH: - (when (eq major-mode 'eshell-mode) + (when (derived-mode-p 'eshell-mode) (setq eshell-path-env value))))))) ;;;###autoload