[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r103518: Make eshell-for obsolete (re
From: |
Glenn Morris |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r103518: Make eshell-for obsolete (replaced by dolist) |
Date: |
Fri, 04 Mar 2011 19:53:41 -0800 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 103518
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Fri 2011-03-04 19:53:41 -0800
message:
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.
modified:
lisp/ChangeLog
lisp/eshell/em-alias.el
lisp/eshell/em-dirs.el
lisp/eshell/em-hist.el
lisp/eshell/em-ls.el
lisp/eshell/em-unix.el
lisp/eshell/esh-cmd.el
lisp/eshell/esh-ext.el
lisp/eshell/esh-mode.el
lisp/eshell/esh-module.el
lisp/eshell/esh-proc.el
lisp/eshell/esh-test.el
lisp/eshell/esh-util.el
lisp/eshell/esh-var.el
lisp/eshell/eshell.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2011-03-04 17:24:02 +0000
+++ b/lisp/ChangeLog 2011-03-05 03:53:41 +0000
@@ -1,3 +1,26 @@
+2011-03-05 Glenn Morris <address@hidden>
+
+ * 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.
+
2011-03-04 Glenn Morris <address@hidden>
* vc/vc-bzr.el (vc-bzr-after-dir-status): Handle bzr 2.3.0. (Bug#8170)
=== modified file 'lisp/eshell/em-alias.el'
--- a/lisp/eshell/em-alias.el 2011-01-25 04:08:28 +0000
+++ b/lisp/eshell/em-alias.el 2011-03-05 03:53:41 +0000
@@ -156,7 +156,7 @@
(defun eshell/alias (&optional alias &rest definition)
"Define an ALIAS in the user's alias list using DEFINITION."
(if (not alias)
- (eshell-for alias eshell-command-aliases-list
+ (dolist (alias eshell-command-aliases-list)
(eshell-print (apply 'format "alias %s %s\n" alias)))
(if (not definition)
(setq eshell-command-aliases-list
@@ -238,7 +238,7 @@
"Find all possible completions for NAME.
These are all the command aliases which begin with NAME."
(let (completions)
- (eshell-for alias eshell-command-aliases-list
+ (dolist (alias eshell-command-aliases-list)
(if (string-match (concat "^" name) (car alias))
(setq completions (cons (car alias) completions))))
completions))
=== modified file 'lisp/eshell/em-dirs.el'
--- a/lisp/eshell/em-dirs.el 2011-01-25 04:08:28 +0000
+++ b/lisp/eshell/em-dirs.el 2011-03-05 03:53:41 +0000
@@ -233,7 +233,7 @@
(defun eshell-save-some-last-dir ()
"Save the list-dir-ring for any open Eshell buffers."
- (eshell-for buf (buffer-list)
+ (dolist (buf (buffer-list))
(if (buffer-live-p buf)
(with-current-buffer buf
(if (and eshell-mode
=== modified file 'lisp/eshell/em-hist.el'
--- a/lisp/eshell/em-hist.el 2011-01-25 04:08:28 +0000
+++ b/lisp/eshell/em-hist.el 2011-03-05 03:53:41 +0000
@@ -292,7 +292,7 @@
(defun eshell-save-some-history ()
"Save the history for any open Eshell buffers."
- (eshell-for buf (buffer-list)
+ (dolist (buf (buffer-list))
(if (buffer-live-p buf)
(with-current-buffer buf
(if (and eshell-mode
@@ -730,7 +730,7 @@
(narrow-to-region here (point))
(goto-char (point-min))
(let ((modifiers (cdr (eshell-parse-modifiers))))
- (eshell-for mod modifiers
+ (dolist (mod modifiers)
(setq hist (funcall mod hist)))
hist))
(delete-region here (point)))))
=== modified file 'lisp/eshell/em-ls.el'
--- a/lisp/eshell/em-ls.el 2011-01-25 04:08:28 +0000
+++ b/lisp/eshell/em-ls.el 2011-03-05 03:53:41 +0000
@@ -561,7 +561,7 @@
(when (or (eq listing-style 'long-listing) show-size)
(let ((total 0.0))
(setq size-width 0)
- (eshell-for e entries
+ (dolist (e entries)
(if (nth 7 (cdr e))
(setq total (+ total (nth 7 (cdr e)))
size-width
@@ -651,7 +651,7 @@
(not (eq eshell-in-pipeline-p 'last))
(not (eq listing-style 'by-lines)))
(memq listing-style '(long-listing single-column)))
- (eshell-for file files
+ (dolist (file files)
(if file
(eshell-ls-file file size-width copy-fileinfo)))
(let ((f files)
@@ -676,7 +676,7 @@
(setcdr f (cddr f))))))
(if (not show-size)
(setq display-files (mapcar 'eshell-ls-annotate files))
- (eshell-for file files
+ (dolist (file files)
(let* ((str (eshell-ls-printable-size (nth 7 (cdr file)) t))
(len (length str)))
(if (< len size-width)
@@ -696,7 +696,7 @@
(columns (length col-widths))
(col-index 1)
need-return)
- (eshell-for file display-files
+ (dolist (file display-files)
(let ((name
(if (car file)
(if show-size
@@ -731,7 +731,7 @@
which non-absolute directory names will be made relative if ever they
need to be printed."
(let (dirs files show-names need-return (size-width 0))
- (eshell-for entry entries
+ (dolist (entry entries)
(if (and (not dir-literal)
(or (eshell-ls-filetype-p (cdr entry) ?d)
(and (eshell-ls-filetype-p (cdr entry) ?l)
@@ -757,7 +757,7 @@
(setq need-return t))
(setq show-names (or show-recursive
(> (+ (length files) (length dirs)) 1)))
- (eshell-for dir (eshell-ls-sort-entries dirs)
+ (dolist (dir (eshell-ls-sort-entries dirs))
(if (and need-return (not dir-literal))
(funcall insert-func "\n"))
(eshell-ls-dir dir show-names
=== modified file 'lisp/eshell/em-unix.el'
--- a/lisp/eshell/em-unix.el 2011-01-25 04:08:28 +0000
+++ b/lisp/eshell/em-unix.el 2011-03-05 03:53:41 +0000
@@ -587,7 +587,7 @@
(setq args (eshell-stringify-list (eshell-flatten-list args)))
(if (or eshell-in-pipeline-p
(catch 'special
- (eshell-for arg args
+ (dolist (arg args)
(unless (or (and (stringp arg)
(> (length arg) 0)
(eq (aref arg 0) ?-))
@@ -610,12 +610,12 @@
:show-usage
:usage "[OPTION] FILE...
Concatenate FILE(s), or standard input, to standard output.")
- (eshell-for file args
+ (dolist (file args)
(if (string= file "-")
(throw 'eshell-external
(eshell-external-command "cat" args))))
(let ((curbuf (current-buffer)))
- (eshell-for file args
+ (dolist (file args)
(with-temp-buffer
(insert-file-contents file)
(goto-char (point-min))
@@ -851,7 +851,7 @@
(let ((ext-du (eshell-search-path "du")))
(if (and ext-du
(not (catch 'have-ange-path
- (eshell-for arg args
+ (dolist (arg args)
(if (string-equal
(file-remote-p (expand-file-name arg) 'method) "ftp")
(throw 'have-ange-path t))))))
@@ -1055,7 +1055,7 @@
"localhost"))
(dir (or (file-remote-p default-directory 'localname)
(expand-file-name default-directory))))
- (eshell-for arg args
+ (dolist (arg args)
(if (string-equal arg "-") (setq login t) (setq user arg)))
;; `eshell-eval-using-options' does not handle "-".
(if (member "-" orig-args) (setq login t))
=== modified file 'lisp/eshell/esh-cmd.el'
--- a/lisp/eshell/esh-cmd.el 2011-01-25 04:08:28 +0000
+++ b/lisp/eshell/esh-cmd.el 2011-03-05 03:53:41 +0000
@@ -987,7 +987,7 @@
(not (member name eshell-complex-commands))
(catch 'simple
(progn
- (eshell-for pred eshell-complex-commands
+ (dolist (pred eshell-complex-commands)
(if (and (functionp pred)
(funcall pred name))
(throw 'simple nil)))
@@ -1165,7 +1165,7 @@
(if (and (eq (car form) 'let)
(not (eq (car (cadr args)) 'eshell-do-eval)))
(eshell-manipulate "evaluating let args"
- (eshell-for letarg (car args)
+ (dolist (letarg (car args))
(if (and (listp letarg)
(not (eq (cadr letarg) 'quote)))
(setcdr letarg
@@ -1241,7 +1241,7 @@
(defun eshell/which (command &rest names)
"Identify the COMMAND, and where it is located."
- (eshell-for name (cons command names)
+ (dolist (name (cons command names))
(let (program alias direct)
(if (eq (aref name 0) eshell-explicit-command-char)
(setq name (substring name 1)
=== modified file 'lisp/eshell/esh-ext.el'
--- a/lisp/eshell/esh-ext.el 2011-02-22 05:50:25 +0000
+++ b/lisp/eshell/esh-ext.el 2011-03-05 03:53:41 +0000
@@ -263,7 +263,7 @@
(let ((finterp
(catch 'found
(ignore
- (eshell-for possible eshell-interpreter-alist
+ (dolist (possible eshell-interpreter-alist)
(cond
((functionp (car possible))
(and (funcall (car possible) file)
=== modified file 'lisp/eshell/esh-mode.el'
--- a/lisp/eshell/esh-mode.el 2011-01-25 04:08:28 +0000
+++ b/lisp/eshell/esh-mode.el 2011-03-05 03:53:41 +0000
@@ -389,7 +389,7 @@
;; load extension modules into memory. This will cause any global
;; variables they define to be visible, since some of the core
;; modules sometimes take advantage of their functionality if used.
- (eshell-for module eshell-modules-list
+ (dolist (module eshell-modules-list)
(let ((module-fullname (symbol-name module))
module-shortname)
(if (string-match "^eshell-\\(.*\\)" module-fullname)
@@ -404,12 +404,12 @@
(eshell-make-private-directory eshell-directory-name t))
;; load core Eshell modules for this session
- (eshell-for module (eshell-subgroups 'eshell)
+ (dolist (module (eshell-subgroups 'eshell))
(run-hooks (intern-soft (concat (symbol-name module)
"-load-hook"))))
;; load extension modules for this session
- (eshell-for module eshell-modules-list
+ (dolist (module eshell-modules-list)
(let ((load-hook (intern-soft (concat (symbol-name module)
"-load-hook"))))
(if (and load-hook (boundp load-hook))
=== modified file 'lisp/eshell/esh-module.el'
--- a/lisp/eshell/esh-module.el 2011-01-25 04:08:28 +0000
+++ b/lisp/eshell/esh-module.el 2011-03-05 03:53:41 +0000
@@ -92,7 +92,7 @@
(defun eshell-unload-extension-modules ()
"Unload any memory resident extension modules."
- (eshell-for module (eshell-subgroups 'eshell-module)
+ (dolist (module (eshell-subgroups 'eshell-module))
(if (featurep module)
(ignore-errors
(message "Unloading %s..." (symbol-name module))
=== modified file 'lisp/eshell/esh-proc.el'
--- a/lisp/eshell/esh-proc.el 2011-01-25 04:08:28 +0000
+++ b/lisp/eshell/esh-proc.el 2011-03-05 03:53:41 +0000
@@ -398,7 +398,7 @@
If ALL is non-nil, background processes will be interacted with as well.
If QUERY is non-nil, query the user with QUERY before calling FUNC."
(let (defunct result)
- (eshell-for entry eshell-process-list
+ (dolist (entry eshell-process-list)
(if (and (memq (process-status (car entry))
'(run stop open closed))
(or all
@@ -412,7 +412,7 @@
;; clean up the process list; this can get dirty if an error
;; occurred that brought the user into the debugger, and then they
;; quit, so that the sentinel was never called.
- (eshell-for d defunct
+ (dolist (d defunct)
(eshell-remove-process-entry d))
result))
=== modified file 'lisp/eshell/esh-test.el'
--- a/lisp/eshell/esh-test.el 2011-01-25 04:08:28 +0000
+++ b/lisp/eshell/esh-test.el 2011-03-05 03:53:41 +0000
@@ -166,9 +166,9 @@
(insert "Testing Eshell under " (emacs-version))
(switch-to-buffer test-buffer)
(delete-other-windows))
- (eshell-for funcname (sort (all-completions "eshell-test--"
+ (dolist (funcname (sort (all-completions "eshell-test--"
obarray 'functionp)
- 'string-lessp)
+ 'string-lessp))
(with-current-buffer test-buffer
(insert "\n"))
(funcall (intern-soft funcname)))
=== modified file 'lisp/eshell/esh-util.el'
--- a/lisp/eshell/esh-util.el 2011-01-25 04:08:28 +0000
+++ b/lisp/eshell/esh-util.el 2011-03-05 03:53:41 +0000
@@ -296,10 +296,12 @@
(put 'eshell-for 'lisp-indent-function 2)
+(make-obsolete 'eshell-for 'dolist "24.1")
+
(defun eshell-flatten-list (args)
"Flatten any lists within ARGS, so that there are no sublists."
(let ((new-list (list t)))
- (eshell-for a args
+ (dolist (a args)
(if (and (listp a)
(listp (cdr a)))
(nconc new-list (eshell-flatten-list a))
@@ -405,7 +407,7 @@
(unless (listp entries)
(setq entries (list entries)
listified t))
- (eshell-for entry entries
+ (dolist (entry entries)
(unless (and exclude (string-match exclude entry))
(setq p predicates valid (null p))
(while p
=== modified file 'lisp/eshell/esh-var.el'
--- a/lisp/eshell/esh-var.el 2011-01-25 04:08:28 +0000
+++ b/lisp/eshell/esh-var.el 2011-03-05 03:53:41 +0000
@@ -351,8 +351,7 @@
'((?h "help" nil nil "show this usage screen")
:external "env"
:usage "<no arguments>")
- (eshell-for setting (sort (eshell-environment-variables)
- 'string-lessp)
+ (dolist (setting (sort (eshell-environment-variables) 'string-lessp))
(eshell-buffered-print setting "\n"))
(eshell-flush)))
@@ -374,7 +373,7 @@
This involves setting any variable aliases which affect the
environment, as specified in `eshell-variable-aliases-list'."
(let ((process-environment (eshell-copy-environment)))
- (eshell-for var-alias eshell-variable-aliases-list
+ (dolist (var-alias eshell-variable-aliases-list)
(if (nth 2 var-alias)
(setenv (car var-alias)
(eshell-stringify
@@ -623,7 +622,7 @@
"Generate list of applicable variables."
(let ((argname pcomplete-stub)
completions)
- (eshell-for alias eshell-variable-aliases-list
+ (dolist (alias eshell-variable-aliases-list)
(if (string-match (concat "^" argname) (car alias))
(setq completions (cons (car alias) completions))))
(sort
=== modified file 'lisp/eshell/eshell.el'
--- a/lisp/eshell/eshell.el 2011-01-25 04:08:28 +0000
+++ b/lisp/eshell/eshell.el 2011-03-05 03:53:41 +0000
@@ -474,7 +474,7 @@
;; if the user set `eshell-prefer-to-shell' to t, but never loaded
;; Eshell, then `eshell-subgroups' will be unbound
(when (fboundp 'eshell-subgroups)
- (eshell-for module (eshell-subgroups 'eshell)
+ (dolist (module (eshell-subgroups 'eshell))
;; this really only unloads as many modules as possible,
;; since other `require' references (such as by customizing
;; `eshell-prefer-to-shell' to a non-nil value) might make it
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r103518: Make eshell-for obsolete (replaced by dolist),
Glenn Morris <=