* lisp/eshell/esh-ext.el (eshell/addpath): Use mapconcat.
authorGlenn Morris <rgm@gnu.org>
Mon, 6 Aug 2012 07:10:27 +0000 (00:10 -0700)
committerGlenn Morris <rgm@gnu.org>
Mon, 6 Aug 2012 07:10:27 +0000 (00:10 -0700)
lisp/ChangeLog
lisp/eshell/esh-ext.el

index 8867ec5..8088a51 100644 (file)
@@ -21,7 +21,7 @@
 
 2012-08-06  Glenn Morris  <rgm@gnu.org>
 
-       * 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  <cyd@gnu.org>
index c0add04..52df158 100644 (file)
@@ -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)))))