+2012-08-06 Glenn Morris <rgm@gnu.org>
+
+ * eshell/esh-ext.el (eshell/addpath): Use dolist.
+ Do less getting and setting of environment variables.
+
2012-08-05 Chong Yidong <cyd@gnu.org>
* proced.el (proced): Add substitution string to docstring to
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)