From 5eaeacb595f4432c598cdd9f4c11763648983f62 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 5 Aug 2012 18:23:37 -0700 Subject: [PATCH] Tweak previous esh-ext.el change * lisp/eshell/esh-ext.el (eshell/addpath): Use dolist. Do less getting and setting of environment variables. --- lisp/ChangeLog | 5 +++++ lisp/eshell/esh-ext.el | 24 +++++++++--------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 289fbf4a225..484a5c5cedf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-06 Glenn Morris + + * eshell/esh-ext.el (eshell/addpath): Use dolist. + Do less getting and setting of environment variables. + 2012-08-05 Chong Yidong * proced.el (proced): Add substitution string to docstring to diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el index 17020245575..c0add0443cb 100644 --- a/lisp/eshell/esh-ext.el +++ b/lisp/eshell/esh-ext.el @@ -226,21 +226,15 @@ causing the user to wonder if anything's really going on..." Adds the given PATH to $PATH.") (if args (progn - (if prepend - (setq args (nreverse args))) - (while args - (setenv "PATH" - (if prepend - (concat (car args) path-separator - (getenv "PATH")) - (concat (getenv "PATH") path-separator - (car args)))) - (setq args (cdr args))) - (setq eshell-path-env (getenv "PATH"))) - (let ((paths (parse-colon-path (getenv "PATH")))) - (while paths - (eshell-printn (car paths)) - (setq paths (cdr paths))))))) + (setq eshell-path-env (getenv "PATH")) + (dolist (dir (if prepend (nreverse args) args)) + (setq eshell-path-env + (if prepend + (concat dir path-separator eshell-path-env) + (concat eshell-path-env path-separator dir)))) + (setenv "PATH" eshell-path-env)) + (dolist (dir (parse-colon-path (getenv "PATH"))) + (eshell-printn dir))))) (put 'eshell/addpath 'eshell-no-numeric-conversions t) -- 2.11.4.GIT