]> code.delx.au - gnu-emacs/blobdiff - lisp/eshell/esh-ext.el
* lisp/eshell/esh-ext.el (eshell/addpath): Use mapconcat.
[gnu-emacs] / lisp / eshell / esh-ext.el
index c0add0443cbd7978afbb4db66a4b8b97187e53af..52df1587d5f0449632a39ed7c58dd6fccb683289 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)))))