diff options
| author | Glenn Morris | 2011-03-04 19:53:41 -0800 |
|---|---|---|
| committer | Glenn Morris | 2011-03-04 19:53:41 -0800 |
| commit | a9eeff78d5bdcb9e03055376705e8f31fe145b79 (patch) | |
| tree | d1324a268a41de5545d6d4f16fc89ab223e341e3 /lisp | |
| parent | 85a55d3871ce4efbde1666bd48b4fca1c638ee99 (diff) | |
| download | emacs-a9eeff78d5bdcb9e03055376705e8f31fe145b79.tar.gz emacs-a9eeff78d5bdcb9e03055376705e8f31fe145b79.zip | |
Make eshell-for obsolete (replaced by dolist)
* eshell/esh-util.el (eshell-for): Make it obsolete.
* eshell/em-alias.el (eshell/alias, eshell-alias-completions):
* eshell/em-dirs.el (eshell-save-some-last-dir):
* eshell/em-hist.el (eshell-save-some-history, eshell-hist-parse-modifier):
* eshell/em-ls.el (eshell-ls-dir, eshell-ls-files, eshell-ls-entries):
* eshell/em-unix.el (eshell/cat, eshell/du, eshell/su):
* eshell/esh-cmd.el (eshell-invoke-directly, eshell-do-eval, eshell/which):
* eshell/esh-ext.el (eshell-find-interpreter):
* eshell/esh-mode.el (eshell-mode):
* eshell/esh-module.el (eshell-unload-extension-modules):
* eshell/esh-proc.el (eshell-process-interact):
* eshell/esh-test.el (eshell-test):
* eshell/esh-util.el (eshell-flatten-list, eshell-winnow-list):
* eshell/esh-var.el (eshell/env, eshell-environment-variables)
(eshell-variables-list):
* eshell/eshell.el (eshell-unload-all-modules):
Replace eshell-for with dolist.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 23 | ||||
| -rw-r--r-- | lisp/eshell/em-alias.el | 4 | ||||
| -rw-r--r-- | lisp/eshell/em-dirs.el | 2 | ||||
| -rw-r--r-- | lisp/eshell/em-hist.el | 4 | ||||
| -rw-r--r-- | lisp/eshell/em-ls.el | 12 | ||||
| -rw-r--r-- | lisp/eshell/em-unix.el | 10 | ||||
| -rw-r--r-- | lisp/eshell/esh-cmd.el | 6 | ||||
| -rw-r--r-- | lisp/eshell/esh-ext.el | 2 | ||||
| -rw-r--r-- | lisp/eshell/esh-mode.el | 6 | ||||
| -rw-r--r-- | lisp/eshell/esh-module.el | 2 | ||||
| -rw-r--r-- | lisp/eshell/esh-proc.el | 4 | ||||
| -rw-r--r-- | lisp/eshell/esh-test.el | 4 | ||||
| -rw-r--r-- | lisp/eshell/esh-util.el | 6 | ||||
| -rw-r--r-- | lisp/eshell/esh-var.el | 7 | ||||
| -rw-r--r-- | lisp/eshell/eshell.el | 2 |
15 files changed, 59 insertions, 35 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2fca345992d..9d4743107cf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,26 @@ | |||
| 1 | 2011-03-05 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * eshell/esh-util.el (eshell-for): Make it obsolete. | ||
| 4 | * eshell/em-alias.el (eshell/alias, eshell-alias-completions): | ||
| 5 | * eshell/em-dirs.el (eshell-save-some-last-dir): | ||
| 6 | * eshell/em-hist.el (eshell-save-some-history) | ||
| 7 | (eshell-hist-parse-modifier): | ||
| 8 | * eshell/em-ls.el (eshell-ls-dir, eshell-ls-files) | ||
| 9 | (eshell-ls-entries): | ||
| 10 | * eshell/em-unix.el (eshell/cat, eshell/du, eshell/su): | ||
| 11 | * eshell/esh-cmd.el (eshell-invoke-directly, eshell-do-eval) | ||
| 12 | (eshell/which): | ||
| 13 | * eshell/esh-ext.el (eshell-find-interpreter): | ||
| 14 | * eshell/esh-mode.el (eshell-mode): | ||
| 15 | * eshell/esh-module.el (eshell-unload-extension-modules): | ||
| 16 | * eshell/esh-proc.el (eshell-process-interact): | ||
| 17 | * eshell/esh-test.el (eshell-test): | ||
| 18 | * eshell/esh-util.el (eshell-flatten-list, eshell-winnow-list): | ||
| 19 | * eshell/esh-var.el (eshell/env, eshell-environment-variables) | ||
| 20 | (eshell-variables-list): | ||
| 21 | * eshell/eshell.el (eshell-unload-all-modules): | ||
| 22 | Replace eshell-for with dolist. | ||
| 23 | |||
| 1 | 2011-03-04 Glenn Morris <rgm@gnu.org> | 24 | 2011-03-04 Glenn Morris <rgm@gnu.org> |
| 2 | 25 | ||
| 3 | * vc/vc-bzr.el (vc-bzr-after-dir-status): Handle bzr 2.3.0. (Bug#8170) | 26 | * vc/vc-bzr.el (vc-bzr-after-dir-status): Handle bzr 2.3.0. (Bug#8170) |
diff --git a/lisp/eshell/em-alias.el b/lisp/eshell/em-alias.el index aa138cb4dcb..9efa95fc9ab 100644 --- a/lisp/eshell/em-alias.el +++ b/lisp/eshell/em-alias.el | |||
| @@ -156,7 +156,7 @@ command, which will automatically write them to the file named by | |||
| 156 | (defun eshell/alias (&optional alias &rest definition) | 156 | (defun eshell/alias (&optional alias &rest definition) |
| 157 | "Define an ALIAS in the user's alias list using DEFINITION." | 157 | "Define an ALIAS in the user's alias list using DEFINITION." |
| 158 | (if (not alias) | 158 | (if (not alias) |
| 159 | (eshell-for alias eshell-command-aliases-list | 159 | (dolist (alias eshell-command-aliases-list) |
| 160 | (eshell-print (apply 'format "alias %s %s\n" alias))) | 160 | (eshell-print (apply 'format "alias %s %s\n" alias))) |
| 161 | (if (not definition) | 161 | (if (not definition) |
| 162 | (setq eshell-command-aliases-list | 162 | (setq eshell-command-aliases-list |
| @@ -238,7 +238,7 @@ command, which will automatically write them to the file named by | |||
| 238 | "Find all possible completions for NAME. | 238 | "Find all possible completions for NAME. |
| 239 | These are all the command aliases which begin with NAME." | 239 | These are all the command aliases which begin with NAME." |
| 240 | (let (completions) | 240 | (let (completions) |
| 241 | (eshell-for alias eshell-command-aliases-list | 241 | (dolist (alias eshell-command-aliases-list) |
| 242 | (if (string-match (concat "^" name) (car alias)) | 242 | (if (string-match (concat "^" name) (car alias)) |
| 243 | (setq completions (cons (car alias) completions)))) | 243 | (setq completions (cons (car alias) completions)))) |
| 244 | completions)) | 244 | completions)) |
diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el index 64555ab15ef..9165f69d0b1 100644 --- a/lisp/eshell/em-dirs.el +++ b/lisp/eshell/em-dirs.el | |||
| @@ -233,7 +233,7 @@ Thus, this does not include the current directory.") | |||
| 233 | 233 | ||
| 234 | (defun eshell-save-some-last-dir () | 234 | (defun eshell-save-some-last-dir () |
| 235 | "Save the list-dir-ring for any open Eshell buffers." | 235 | "Save the list-dir-ring for any open Eshell buffers." |
| 236 | (eshell-for buf (buffer-list) | 236 | (dolist (buf (buffer-list)) |
| 237 | (if (buffer-live-p buf) | 237 | (if (buffer-live-p buf) |
| 238 | (with-current-buffer buf | 238 | (with-current-buffer buf |
| 239 | (if (and eshell-mode | 239 | (if (and eshell-mode |
diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el index 5ec529f4b8f..f9ddf3b679f 100644 --- a/lisp/eshell/em-hist.el +++ b/lisp/eshell/em-hist.el | |||
| @@ -292,7 +292,7 @@ element, regardless of any text on the command line. In that case, | |||
| 292 | 292 | ||
| 293 | (defun eshell-save-some-history () | 293 | (defun eshell-save-some-history () |
| 294 | "Save the history for any open Eshell buffers." | 294 | "Save the history for any open Eshell buffers." |
| 295 | (eshell-for buf (buffer-list) | 295 | (dolist (buf (buffer-list)) |
| 296 | (if (buffer-live-p buf) | 296 | (if (buffer-live-p buf) |
| 297 | (with-current-buffer buf | 297 | (with-current-buffer buf |
| 298 | (if (and eshell-mode | 298 | (if (and eshell-mode |
| @@ -730,7 +730,7 @@ matched." | |||
| 730 | (narrow-to-region here (point)) | 730 | (narrow-to-region here (point)) |
| 731 | (goto-char (point-min)) | 731 | (goto-char (point-min)) |
| 732 | (let ((modifiers (cdr (eshell-parse-modifiers)))) | 732 | (let ((modifiers (cdr (eshell-parse-modifiers)))) |
| 733 | (eshell-for mod modifiers | 733 | (dolist (mod modifiers) |
| 734 | (setq hist (funcall mod hist))) | 734 | (setq hist (funcall mod hist))) |
| 735 | hist)) | 735 | hist)) |
| 736 | (delete-region here (point))))) | 736 | (delete-region here (point))))) |
diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el index 7714629f2fa..4ef259dee4b 100644 --- a/lisp/eshell/em-ls.el +++ b/lisp/eshell/em-ls.el | |||
| @@ -561,7 +561,7 @@ relative to that directory." | |||
| 561 | (when (or (eq listing-style 'long-listing) show-size) | 561 | (when (or (eq listing-style 'long-listing) show-size) |
| 562 | (let ((total 0.0)) | 562 | (let ((total 0.0)) |
| 563 | (setq size-width 0) | 563 | (setq size-width 0) |
| 564 | (eshell-for e entries | 564 | (dolist (e entries) |
| 565 | (if (nth 7 (cdr e)) | 565 | (if (nth 7 (cdr e)) |
| 566 | (setq total (+ total (nth 7 (cdr e))) | 566 | (setq total (+ total (nth 7 (cdr e))) |
| 567 | size-width | 567 | size-width |
| @@ -651,7 +651,7 @@ Each member of FILES is either a string or a cons cell of the form | |||
| 651 | (not (eq eshell-in-pipeline-p 'last)) | 651 | (not (eq eshell-in-pipeline-p 'last)) |
| 652 | (not (eq listing-style 'by-lines))) | 652 | (not (eq listing-style 'by-lines))) |
| 653 | (memq listing-style '(long-listing single-column))) | 653 | (memq listing-style '(long-listing single-column))) |
| 654 | (eshell-for file files | 654 | (dolist (file files) |
| 655 | (if file | 655 | (if file |
| 656 | (eshell-ls-file file size-width copy-fileinfo))) | 656 | (eshell-ls-file file size-width copy-fileinfo))) |
| 657 | (let ((f files) | 657 | (let ((f files) |
| @@ -676,7 +676,7 @@ Each member of FILES is either a string or a cons cell of the form | |||
| 676 | (setcdr f (cddr f)))))) | 676 | (setcdr f (cddr f)))))) |
| 677 | (if (not show-size) | 677 | (if (not show-size) |
| 678 | (setq display-files (mapcar 'eshell-ls-annotate files)) | 678 | (setq display-files (mapcar 'eshell-ls-annotate files)) |
| 679 | (eshell-for file files | 679 | (dolist (file files) |
| 680 | (let* ((str (eshell-ls-printable-size (nth 7 (cdr file)) t)) | 680 | (let* ((str (eshell-ls-printable-size (nth 7 (cdr file)) t)) |
| 681 | (len (length str))) | 681 | (len (length str))) |
| 682 | (if (< len size-width) | 682 | (if (< len size-width) |
| @@ -696,7 +696,7 @@ Each member of FILES is either a string or a cons cell of the form | |||
| 696 | (columns (length col-widths)) | 696 | (columns (length col-widths)) |
| 697 | (col-index 1) | 697 | (col-index 1) |
| 698 | need-return) | 698 | need-return) |
| 699 | (eshell-for file display-files | 699 | (dolist (file display-files) |
| 700 | (let ((name | 700 | (let ((name |
| 701 | (if (car file) | 701 | (if (car file) |
| 702 | (if show-size | 702 | (if show-size |
| @@ -731,7 +731,7 @@ ROOT-DIR, if non-nil, specifies the root directory of the listing, to | |||
| 731 | which non-absolute directory names will be made relative if ever they | 731 | which non-absolute directory names will be made relative if ever they |
| 732 | need to be printed." | 732 | need to be printed." |
| 733 | (let (dirs files show-names need-return (size-width 0)) | 733 | (let (dirs files show-names need-return (size-width 0)) |
| 734 | (eshell-for entry entries | 734 | (dolist (entry entries) |
| 735 | (if (and (not dir-literal) | 735 | (if (and (not dir-literal) |
| 736 | (or (eshell-ls-filetype-p (cdr entry) ?d) | 736 | (or (eshell-ls-filetype-p (cdr entry) ?d) |
| 737 | (and (eshell-ls-filetype-p (cdr entry) ?l) | 737 | (and (eshell-ls-filetype-p (cdr entry) ?l) |
| @@ -757,7 +757,7 @@ need to be printed." | |||
| 757 | (setq need-return t)) | 757 | (setq need-return t)) |
| 758 | (setq show-names (or show-recursive | 758 | (setq show-names (or show-recursive |
| 759 | (> (+ (length files) (length dirs)) 1))) | 759 | (> (+ (length files) (length dirs)) 1))) |
| 760 | (eshell-for dir (eshell-ls-sort-entries dirs) | 760 | (dolist (dir (eshell-ls-sort-entries dirs)) |
| 761 | (if (and need-return (not dir-literal)) | 761 | (if (and need-return (not dir-literal)) |
| 762 | (funcall insert-func "\n")) | 762 | (funcall insert-func "\n")) |
| 763 | (eshell-ls-dir dir show-names | 763 | (eshell-ls-dir dir show-names |
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index dc5650d240e..3bb623c4c4e 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el | |||
| @@ -587,7 +587,7 @@ symlink, then revert to the system's definition of cat." | |||
| 587 | (setq args (eshell-stringify-list (eshell-flatten-list args))) | 587 | (setq args (eshell-stringify-list (eshell-flatten-list args))) |
| 588 | (if (or eshell-in-pipeline-p | 588 | (if (or eshell-in-pipeline-p |
| 589 | (catch 'special | 589 | (catch 'special |
| 590 | (eshell-for arg args | 590 | (dolist (arg args) |
| 591 | (unless (or (and (stringp arg) | 591 | (unless (or (and (stringp arg) |
| 592 | (> (length arg) 0) | 592 | (> (length arg) 0) |
| 593 | (eq (aref arg 0) ?-)) | 593 | (eq (aref arg 0) ?-)) |
| @@ -610,12 +610,12 @@ symlink, then revert to the system's definition of cat." | |||
| 610 | :show-usage | 610 | :show-usage |
| 611 | :usage "[OPTION] FILE... | 611 | :usage "[OPTION] FILE... |
| 612 | Concatenate FILE(s), or standard input, to standard output.") | 612 | Concatenate FILE(s), or standard input, to standard output.") |
| 613 | (eshell-for file args | 613 | (dolist (file args) |
| 614 | (if (string= file "-") | 614 | (if (string= file "-") |
| 615 | (throw 'eshell-external | 615 | (throw 'eshell-external |
| 616 | (eshell-external-command "cat" args)))) | 616 | (eshell-external-command "cat" args)))) |
| 617 | (let ((curbuf (current-buffer))) | 617 | (let ((curbuf (current-buffer))) |
| 618 | (eshell-for file args | 618 | (dolist (file args) |
| 619 | (with-temp-buffer | 619 | (with-temp-buffer |
| 620 | (insert-file-contents file) | 620 | (insert-file-contents file) |
| 621 | (goto-char (point-min)) | 621 | (goto-char (point-min)) |
| @@ -851,7 +851,7 @@ external command." | |||
| 851 | (let ((ext-du (eshell-search-path "du"))) | 851 | (let ((ext-du (eshell-search-path "du"))) |
| 852 | (if (and ext-du | 852 | (if (and ext-du |
| 853 | (not (catch 'have-ange-path | 853 | (not (catch 'have-ange-path |
| 854 | (eshell-for arg args | 854 | (dolist (arg args) |
| 855 | (if (string-equal | 855 | (if (string-equal |
| 856 | (file-remote-p (expand-file-name arg) 'method) "ftp") | 856 | (file-remote-p (expand-file-name arg) 'method) "ftp") |
| 857 | (throw 'have-ange-path t)))))) | 857 | (throw 'have-ange-path t)))))) |
| @@ -1055,7 +1055,7 @@ Become another USER during a login session.") | |||
| 1055 | "localhost")) | 1055 | "localhost")) |
| 1056 | (dir (or (file-remote-p default-directory 'localname) | 1056 | (dir (or (file-remote-p default-directory 'localname) |
| 1057 | (expand-file-name default-directory)))) | 1057 | (expand-file-name default-directory)))) |
| 1058 | (eshell-for arg args | 1058 | (dolist (arg args) |
| 1059 | (if (string-equal arg "-") (setq login t) (setq user arg))) | 1059 | (if (string-equal arg "-") (setq login t) (setq user arg))) |
| 1060 | ;; `eshell-eval-using-options' does not handle "-". | 1060 | ;; `eshell-eval-using-options' does not handle "-". |
| 1061 | (if (member "-" orig-args) (setq login t)) | 1061 | (if (member "-" orig-args) (setq login t)) |
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index 0567beb9a53..0a00300d19c 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el | |||
| @@ -987,7 +987,7 @@ at the moment are: | |||
| 987 | (not (member name eshell-complex-commands)) | 987 | (not (member name eshell-complex-commands)) |
| 988 | (catch 'simple | 988 | (catch 'simple |
| 989 | (progn | 989 | (progn |
| 990 | (eshell-for pred eshell-complex-commands | 990 | (dolist (pred eshell-complex-commands) |
| 991 | (if (and (functionp pred) | 991 | (if (and (functionp pred) |
| 992 | (funcall pred name)) | 992 | (funcall pred name)) |
| 993 | (throw 'simple nil))) | 993 | (throw 'simple nil))) |
| @@ -1165,7 +1165,7 @@ be finished later after the completion of an asynchronous subprocess." | |||
| 1165 | (if (and (eq (car form) 'let) | 1165 | (if (and (eq (car form) 'let) |
| 1166 | (not (eq (car (cadr args)) 'eshell-do-eval))) | 1166 | (not (eq (car (cadr args)) 'eshell-do-eval))) |
| 1167 | (eshell-manipulate "evaluating let args" | 1167 | (eshell-manipulate "evaluating let args" |
| 1168 | (eshell-for letarg (car args) | 1168 | (dolist (letarg (car args)) |
| 1169 | (if (and (listp letarg) | 1169 | (if (and (listp letarg) |
| 1170 | (not (eq (cadr letarg) 'quote))) | 1170 | (not (eq (cadr letarg) 'quote))) |
| 1171 | (setcdr letarg | 1171 | (setcdr letarg |
| @@ -1241,7 +1241,7 @@ be finished later after the completion of an asynchronous subprocess." | |||
| 1241 | 1241 | ||
| 1242 | (defun eshell/which (command &rest names) | 1242 | (defun eshell/which (command &rest names) |
| 1243 | "Identify the COMMAND, and where it is located." | 1243 | "Identify the COMMAND, and where it is located." |
| 1244 | (eshell-for name (cons command names) | 1244 | (dolist (name (cons command names)) |
| 1245 | (let (program alias direct) | 1245 | (let (program alias direct) |
| 1246 | (if (eq (aref name 0) eshell-explicit-command-char) | 1246 | (if (eq (aref name 0) eshell-explicit-command-char) |
| 1247 | (setq name (substring name 1) | 1247 | (setq name (substring name 1) |
diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el index 7128d7e4749..ebd20b90dd6 100644 --- a/lisp/eshell/esh-ext.el +++ b/lisp/eshell/esh-ext.el | |||
| @@ -263,7 +263,7 @@ line of the form #!<interp>." | |||
| 263 | (let ((finterp | 263 | (let ((finterp |
| 264 | (catch 'found | 264 | (catch 'found |
| 265 | (ignore | 265 | (ignore |
| 266 | (eshell-for possible eshell-interpreter-alist | 266 | (dolist (possible eshell-interpreter-alist) |
| 267 | (cond | 267 | (cond |
| 268 | ((functionp (car possible)) | 268 | ((functionp (car possible)) |
| 269 | (and (funcall (car possible) file) | 269 | (and (funcall (car possible) file) |
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index 3735ee35fd5..3b566ead0e5 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el | |||
| @@ -389,7 +389,7 @@ This is used by `eshell-watch-for-password-prompt'." | |||
| 389 | ;; load extension modules into memory. This will cause any global | 389 | ;; load extension modules into memory. This will cause any global |
| 390 | ;; variables they define to be visible, since some of the core | 390 | ;; variables they define to be visible, since some of the core |
| 391 | ;; modules sometimes take advantage of their functionality if used. | 391 | ;; modules sometimes take advantage of their functionality if used. |
| 392 | (eshell-for module eshell-modules-list | 392 | (dolist (module eshell-modules-list) |
| 393 | (let ((module-fullname (symbol-name module)) | 393 | (let ((module-fullname (symbol-name module)) |
| 394 | module-shortname) | 394 | module-shortname) |
| 395 | (if (string-match "^eshell-\\(.*\\)" module-fullname) | 395 | (if (string-match "^eshell-\\(.*\\)" module-fullname) |
| @@ -404,12 +404,12 @@ This is used by `eshell-watch-for-password-prompt'." | |||
| 404 | (eshell-make-private-directory eshell-directory-name t)) | 404 | (eshell-make-private-directory eshell-directory-name t)) |
| 405 | 405 | ||
| 406 | ;; load core Eshell modules for this session | 406 | ;; load core Eshell modules for this session |
| 407 | (eshell-for module (eshell-subgroups 'eshell) | 407 | (dolist (module (eshell-subgroups 'eshell)) |
| 408 | (run-hooks (intern-soft (concat (symbol-name module) | 408 | (run-hooks (intern-soft (concat (symbol-name module) |
| 409 | "-load-hook")))) | 409 | "-load-hook")))) |
| 410 | 410 | ||
| 411 | ;; load extension modules for this session | 411 | ;; load extension modules for this session |
| 412 | (eshell-for module eshell-modules-list | 412 | (dolist (module eshell-modules-list) |
| 413 | (let ((load-hook (intern-soft (concat (symbol-name module) | 413 | (let ((load-hook (intern-soft (concat (symbol-name module) |
| 414 | "-load-hook")))) | 414 | "-load-hook")))) |
| 415 | (if (and load-hook (boundp load-hook)) | 415 | (if (and load-hook (boundp load-hook)) |
diff --git a/lisp/eshell/esh-module.el b/lisp/eshell/esh-module.el index 5a62c71355c..41f9e662a95 100644 --- a/lisp/eshell/esh-module.el +++ b/lisp/eshell/esh-module.el | |||
| @@ -92,7 +92,7 @@ customization group. Example: `eshell-cmpl' for that module." | |||
| 92 | 92 | ||
| 93 | (defun eshell-unload-extension-modules () | 93 | (defun eshell-unload-extension-modules () |
| 94 | "Unload any memory resident extension modules." | 94 | "Unload any memory resident extension modules." |
| 95 | (eshell-for module (eshell-subgroups 'eshell-module) | 95 | (dolist (module (eshell-subgroups 'eshell-module)) |
| 96 | (if (featurep module) | 96 | (if (featurep module) |
| 97 | (ignore-errors | 97 | (ignore-errors |
| 98 | (message "Unloading %s..." (symbol-name module)) | 98 | (message "Unloading %s..." (symbol-name module)) |
diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el index f697a400556..8757f5d56a0 100644 --- a/lisp/eshell/esh-proc.el +++ b/lisp/eshell/esh-proc.el | |||
| @@ -398,7 +398,7 @@ PROC is the process that's exiting. STRING is the exit message." | |||
| 398 | If ALL is non-nil, background processes will be interacted with as well. | 398 | If ALL is non-nil, background processes will be interacted with as well. |
| 399 | If QUERY is non-nil, query the user with QUERY before calling FUNC." | 399 | If QUERY is non-nil, query the user with QUERY before calling FUNC." |
| 400 | (let (defunct result) | 400 | (let (defunct result) |
| 401 | (eshell-for entry eshell-process-list | 401 | (dolist (entry eshell-process-list) |
| 402 | (if (and (memq (process-status (car entry)) | 402 | (if (and (memq (process-status (car entry)) |
| 403 | '(run stop open closed)) | 403 | '(run stop open closed)) |
| 404 | (or all | 404 | (or all |
| @@ -412,7 +412,7 @@ If QUERY is non-nil, query the user with QUERY before calling FUNC." | |||
| 412 | ;; clean up the process list; this can get dirty if an error | 412 | ;; clean up the process list; this can get dirty if an error |
| 413 | ;; occurred that brought the user into the debugger, and then they | 413 | ;; occurred that brought the user into the debugger, and then they |
| 414 | ;; quit, so that the sentinel was never called. | 414 | ;; quit, so that the sentinel was never called. |
| 415 | (eshell-for d defunct | 415 | (dolist (d defunct) |
| 416 | (eshell-remove-process-entry d)) | 416 | (eshell-remove-process-entry d)) |
| 417 | result)) | 417 | result)) |
| 418 | 418 | ||
diff --git a/lisp/eshell/esh-test.el b/lisp/eshell/esh-test.el index f5c55dd8ae7..73ba16116c0 100644 --- a/lisp/eshell/esh-test.el +++ b/lisp/eshell/esh-test.el | |||
| @@ -166,9 +166,9 @@ | |||
| 166 | (insert "Testing Eshell under " (emacs-version)) | 166 | (insert "Testing Eshell under " (emacs-version)) |
| 167 | (switch-to-buffer test-buffer) | 167 | (switch-to-buffer test-buffer) |
| 168 | (delete-other-windows)) | 168 | (delete-other-windows)) |
| 169 | (eshell-for funcname (sort (all-completions "eshell-test--" | 169 | (dolist (funcname (sort (all-completions "eshell-test--" |
| 170 | obarray 'functionp) | 170 | obarray 'functionp) |
| 171 | 'string-lessp) | 171 | 'string-lessp)) |
| 172 | (with-current-buffer test-buffer | 172 | (with-current-buffer test-buffer |
| 173 | (insert "\n")) | 173 | (insert "\n")) |
| 174 | (funcall (intern-soft funcname))) | 174 | (funcall (intern-soft funcname))) |
diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el index 2de147acb00..6b04b0e727b 100644 --- a/lisp/eshell/esh-util.el +++ b/lisp/eshell/esh-util.el | |||
| @@ -296,10 +296,12 @@ Prepend remote identification of `default-directory', if any." | |||
| 296 | 296 | ||
| 297 | (put 'eshell-for 'lisp-indent-function 2) | 297 | (put 'eshell-for 'lisp-indent-function 2) |
| 298 | 298 | ||
| 299 | (make-obsolete 'eshell-for 'dolist "24.1") | ||
| 300 | |||
| 299 | (defun eshell-flatten-list (args) | 301 | (defun eshell-flatten-list (args) |
| 300 | "Flatten any lists within ARGS, so that there are no sublists." | 302 | "Flatten any lists within ARGS, so that there are no sublists." |
| 301 | (let ((new-list (list t))) | 303 | (let ((new-list (list t))) |
| 302 | (eshell-for a args | 304 | (dolist (a args) |
| 303 | (if (and (listp a) | 305 | (if (and (listp a) |
| 304 | (listp (cdr a))) | 306 | (listp (cdr a))) |
| 305 | (nconc new-list (eshell-flatten-list a)) | 307 | (nconc new-list (eshell-flatten-list a)) |
| @@ -405,7 +407,7 @@ list." | |||
| 405 | (unless (listp entries) | 407 | (unless (listp entries) |
| 406 | (setq entries (list entries) | 408 | (setq entries (list entries) |
| 407 | listified t)) | 409 | listified t)) |
| 408 | (eshell-for entry entries | 410 | (dolist (entry entries) |
| 409 | (unless (and exclude (string-match exclude entry)) | 411 | (unless (and exclude (string-match exclude entry)) |
| 410 | (setq p predicates valid (null p)) | 412 | (setq p predicates valid (null p)) |
| 411 | (while p | 413 | (while p |
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 4c42b305ec2..8fb08963192 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el | |||
| @@ -351,8 +351,7 @@ This function is explicit for adding to `eshell-parse-argument-hook'." | |||
| 351 | '((?h "help" nil nil "show this usage screen") | 351 | '((?h "help" nil nil "show this usage screen") |
| 352 | :external "env" | 352 | :external "env" |
| 353 | :usage "<no arguments>") | 353 | :usage "<no arguments>") |
| 354 | (eshell-for setting (sort (eshell-environment-variables) | 354 | (dolist (setting (sort (eshell-environment-variables) 'string-lessp)) |
| 355 | 'string-lessp) | ||
| 356 | (eshell-buffered-print setting "\n")) | 355 | (eshell-buffered-print setting "\n")) |
| 357 | (eshell-flush))) | 356 | (eshell-flush))) |
| 358 | 357 | ||
| @@ -374,7 +373,7 @@ This function is explicit for adding to `eshell-parse-argument-hook'." | |||
| 374 | This involves setting any variable aliases which affect the | 373 | This involves setting any variable aliases which affect the |
| 375 | environment, as specified in `eshell-variable-aliases-list'." | 374 | environment, as specified in `eshell-variable-aliases-list'." |
| 376 | (let ((process-environment (eshell-copy-environment))) | 375 | (let ((process-environment (eshell-copy-environment))) |
| 377 | (eshell-for var-alias eshell-variable-aliases-list | 376 | (dolist (var-alias eshell-variable-aliases-list) |
| 378 | (if (nth 2 var-alias) | 377 | (if (nth 2 var-alias) |
| 379 | (setenv (car var-alias) | 378 | (setenv (car var-alias) |
| 380 | (eshell-stringify | 379 | (eshell-stringify |
| @@ -623,7 +622,7 @@ For example, to retrieve the second element of a user's record in | |||
| 623 | "Generate list of applicable variables." | 622 | "Generate list of applicable variables." |
| 624 | (let ((argname pcomplete-stub) | 623 | (let ((argname pcomplete-stub) |
| 625 | completions) | 624 | completions) |
| 626 | (eshell-for alias eshell-variable-aliases-list | 625 | (dolist (alias eshell-variable-aliases-list) |
| 627 | (if (string-match (concat "^" argname) (car alias)) | 626 | (if (string-match (concat "^" argname) (car alias)) |
| 628 | (setq completions (cons (car alias) completions)))) | 627 | (setq completions (cons (car alias) completions)))) |
| 629 | (sort | 628 | (sort |
diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el index 7690a102a9b..cda1eea2c55 100644 --- a/lisp/eshell/eshell.el +++ b/lisp/eshell/eshell.el | |||
| @@ -474,7 +474,7 @@ Emacs." | |||
| 474 | ;; if the user set `eshell-prefer-to-shell' to t, but never loaded | 474 | ;; if the user set `eshell-prefer-to-shell' to t, but never loaded |
| 475 | ;; Eshell, then `eshell-subgroups' will be unbound | 475 | ;; Eshell, then `eshell-subgroups' will be unbound |
| 476 | (when (fboundp 'eshell-subgroups) | 476 | (when (fboundp 'eshell-subgroups) |
| 477 | (eshell-for module (eshell-subgroups 'eshell) | 477 | (dolist (module (eshell-subgroups 'eshell)) |
| 478 | ;; this really only unloads as many modules as possible, | 478 | ;; this really only unloads as many modules as possible, |
| 479 | ;; since other `require' references (such as by customizing | 479 | ;; since other `require' references (such as by customizing |
| 480 | ;; `eshell-prefer-to-shell' to a non-nil value) might make it | 480 | ;; `eshell-prefer-to-shell' to a non-nil value) might make it |