From: Glenn Morris Date: Mon, 6 Aug 2012 07:10:27 +0000 (-0700) Subject: * lisp/eshell/esh-ext.el (eshell/addpath): Use mapconcat. X-Git-Tag: emacs-24.2.90~831 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e296d94b3369d05eeeeffde728a8bf5de885c720;p=emacs.git * lisp/eshell/esh-ext.el (eshell/addpath): Use mapconcat. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8867ec557e5..8088a51f591 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -21,7 +21,7 @@ 2012-08-06 Glenn Morris - * eshell/esh-ext.el (eshell/addpath): Use dolist. + * eshell/esh-ext.el (eshell/addpath): Use dolist and mapconcat. Do less getting and setting of environment variables. 2012-08-05 Chong Yidong diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el index c0add0443cb..52df1587d5f 100644 --- a/lisp/eshell/esh-ext.el +++ b/lisp/eshell/esh-ext.el @@ -226,12 +226,12 @@ causing the user to wonder if anything's really going on..." Adds the given PATH to $PATH.") (if args (progn - (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)))) + (setq eshell-path-env (getenv "PATH") + args (mapconcat 'identity args path-separator) + eshell-path-env + (if prepend + (concat args path-separator eshell-path-env) + (concat eshell-path-env path-separator args))) (setenv "PATH" eshell-path-env)) (dolist (dir (parse-colon-path (getenv "PATH"))) (eshell-printn dir)))))