branch: elpa/exec-path-from-shell
commit d8824a3a4edb46ad9bbc36d5245b0542cb71fed8
Author: Matthew Sojourner Newton <[email protected]>
Commit: Matthew Sojourner Newton <[email protected]>

    Set each instance of the buffer local variable eshell-path-env
---
 exec-path-from-shell.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/exec-path-from-shell.el b/exec-path-from-shell.el
index e0e381f42e..1151bafe7b 100644
--- a/exec-path-from-shell.el
+++ b/exec-path-from-shell.el
@@ -225,8 +225,14 @@ Additionally, if NAME is \"PATH\" then also update the
 variables `exec-path' and `eshell-path-env'."
   (setenv name value)
   (when (string-equal "PATH" name)
-    (setq eshell-path-env value
-          exec-path (append (parse-colon-path value) (list exec-directory)))))
+    (setq exec-path (append (parse-colon-path value) (list exec-directory)))
+    ;; `eshell-path-env' is a buffer local variable so we set the default value
+    ;; and then set the value in each `eshell' buffer.
+    (setq-default eshell-path-env value)
+    (dolist (buffer (buffer-list))
+      (with-current-buffer buffer
+        (when (derived-mode-p 'eshell-mode)
+          (setq eshell-path-env value))))))
 
 ;;;###autoload
 (defun exec-path-from-shell-copy-envs (names)

Reply via email to